|
You last visited: Today at 14:58
Advertisement
Write socket through proxy ?
Discussion on Write socket through proxy ? within the Web Development forum part of the Coders Den category.
04/13/2016, 17:28
|
#1
|
elite*gold: 0
Join Date: Jun 2013
Posts: 29
Received Thanks: 9
|
Write socket through proxy ?
Hello everyone,
I am trying to write to a server with a socket, but I want to use a proxy to make that connection, can you help me do that please ?
Here is my proxyless socket connection :
Code:
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
// connect to server
$result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");
// send string to server
socket_write($socket, $message, strlen($message)) or die("Could not send data to server\n");
// get server response
$result = socket_read ($socket, 1024) or die("Could not read server response\n");
|
|
|
04/13/2016, 17:37
|
#2
|
dotCom
elite*gold: 12400
Join Date: Mar 2009
Posts: 15,875
Received Thanks: 4,381
|
Here you go:
|
|
|
04/13/2016, 18:11
|
#3
|
elite*gold: 0
Join Date: Jun 2013
Posts: 29
Received Thanks: 9
|
Hello, thank you for your fast answer, so I went to the link you gave me, and got me redirected to another thread, which talks about cURL and Sockets, so I used this code, but the server won't return me a response ...
My code:
Code:
<?php
$url = "tcp://79.110.84.75:4002";
// $agent= 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';
$packet = "mypacket";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, true);
// curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $packet);
curl_setopt($ch, CURLOPT_PROXY, "212.47.236.192:9008");
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
$result = curl_exec($ch);
echo $result . "hi";
?>
Edit: I also tried adding the simple line socket_bind, but it returns me could not bind socket.. The proxy is use is a chinese socks4/5 proxy, should I use a http proxy instead? (I want to send a packet to a official game server)
Code:
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
socket_bind($socket, $proxy_ip, $proxy_port) or die("Could not bind socket");
$result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");
// send string to server
socket_write($socket, $message, strlen($message)) or die("Could not send data to server\n");
// get server response
$result = socket_read ($socket, 1024) or die("Could not read server response\n");
Up, help please?
|
|
|
Similar Threads
|
Proxy Socket 5 + Login und Passwort
08/08/2014 - World of Warcraft Trading - 0 Replies
Verkaufe Socket 5 Proxy Server Ips zum Botten oder Anonymes Surfen im Internet.
Alles Proxys sind mit Login und Passwort.
Laufzeit : 30 Tage
Stück 3€
Nur Paypal Überweisung oder 4 Stück für 10€ Psc
Pn oder Skype
|
SELLING PRIVATE "Anonymous proxy" socket 4/5
02/19/2014 - Conquer Online 2 Trading - 1 Replies
Just Beep me if your'e interested
Can use this for only botters/Cheaters
Working on : ConquerAI,ConquerGenius,Conquer Chrome!! :D:D:D
|
All times are GMT +2. The time now is 14:58.
|
|