Re: How to limit source IP in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for the top post but I don't have my laptop with me and, well frankly
I'm too tired to be arsed!

I think the confusion is coming from the word bind. I don't think man
people at aware of he difference between binding a socket and having it
listen on the port to which it's bound.

People... when you make an outgoing connect ion (using the curl functions,
the socket functions, or whatever), the socket is bound to an IP and
arbitrary port on the network interface over which the connection is being
made. Antonio is wanting to specify which IP address on the interface is
used (this is the IP address from which the other end will see the
connection coming).

This is not hard to understand but it's not well known that the bonding
process happens to both ends of a socket connection, and from what I've
seen nobody has bothered to explain that.

Apache, nginx, whatever the web server is has nothing to do with the
question. I hope that helps clear it up for those who are confused.

-Stuart

-- 
Sent from my leaf blower
On 14 Sep 2012 21:01, "Tonix (Antonio Nati)" <tonix@xxxxxxxxxxxxxx> wrote:

> Il 14/09/2012 21:19, Jim Lucas ha scritto:
>
>> On 09/13/2012 04:15 PM, Tonix (Antonio Nati) wrote:
>>
>>>
>>> Jim, sorry but you did not read carefully my posts.
>>>
>>> Since the fist post, I ALWAYS spoke about connections a PHP script may
>>> open autonomously (what you name second connection).
>>>
>>> I'm never speaking about listening/intercepting/using the original HTTP
>>> request.
>>>
>>
>> Then why did you bring up apache?  That seems to be the source of
>> confusion...
>>
>>
> There is no confusion at all.
>
> When a script is executing under apache, it can do whatever it wants
> (within its permissions of course), opening other sockets and making any
> kind of processing and IO. It does not interphere with apache connections,
> it just uses new connections.
>
> So, my request is clear: how to force a PHP script to bind only to
> permitted IP (i.e. using directive similar to OPEN_BASEDIR).
>
> The answer is clear. Actually PHP cannot force a PHP script to bind only
> to specific IPs.
>
> So I've filed a request in PHP bug's repository for examining this
> possibility.
>
> In a multi IP apache configuration, I feel right each PHP script should
> only (eventually) bind to the IP where the connection is received, or to a
> permitted IP.
>
> Hope this helps.
>
> Tonino
>
>
>
> --
> ------------------------------**------------------------------
>         Inter@zioni            Interazioni di Antonio Nati
>    http://www.interazioni.it      tonix@xxxxxxxxxxxxxx
> ------------------------------**------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux