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?