I am working on an existing library, and i want it to establish connection to socket via proxy only. Current code is
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$result = socket_connect($socket, "www.host.com", 8080);
Where i want this connection to be established via proxy (SOCK4/5)
I've Tried with
socket_bind($socket, '127.0.0.1', '9150');
Which is vidalia server, also I've tried some proxies from the internet which got working on firefox as sock but couldn't get this code connecting through it.
When i try putting above line i got following error.
Warning: socket_bind(): unable to bind address [10048]: Only one usage of each socket address (protocol/network address/port) is normally permitted.