pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-php@postgresql.org
Subject: Re: How to select the source ip address for a connection to the database server
Date: 7 Sep 2009 10:49:42 GMT
Message-ID: <h82og6$dpv$6@reversiblemaps.ath.cx> (raw)
References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr>
	<4AA30914.7080102@lightlink.com>
	<AEFA6E9872F74EAC83B4BDAA52FA5676@toshiba>

On 2009-09-06, Dimitris Sakellarios <dimitris.sakellarios@telesuite.gr> wrote:
>
> That is the way sockets normally work, the primary address is always 
> used for outgoing connections. It can not be changed without some low 
> level programming. It is necessary to bind the socket to the specific IP 
> address before opening the connection. I have done it with Perl, but not 
> PHP.
>
> Bob McConnell
> N2SPP
>

basically what you need to do is take the libpq source extend the
conneection-string facility to include
bind-to-port and bind-to-address parameters which bind the outgoing
connection to the named resources and then recompile it and get it
installed on your server

no changes are likely to be needed to PHP






view thread (10+ messages)

Message-ID: <h82og6$dpv$6@reversiblemaps.ath.cx>
Permalink:  ../h82og6$dpv$6@reversiblemaps.ath.cx/
Also on:    postgresql.org/message-id/h82og6$dpv$6@reversiblemaps.ath.cx

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: jasen@xnet.co.nz
  Subject: Re: How to select the source ip address for a connection to the database server
  In-Reply-To: <h82og6$dpv$6@reversiblemaps.ath.cx>
  References: <20090902202318.hp0bplmn4kkc48k0@zeus.netdynamics.gr> <4AA30914.7080102@lightlink.com> <AEFA6E9872F74EAC83B4BDAA52FA5676@toshiba> <h82og6$dpv$6@reversiblemaps.ath.cx>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox