Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- php socket question
July 28, 2004, 1:09 am
rate this thread
i want to be able to send a packet to a http server and receive the
response, but i'm not quite sure how to do it. i thought of using
sockets, and although i have worked out how to send data to the http
server, i have no idea how to receive the responses.
any help wuld be greatly appreciated.
this is what i've got so far. i know that the server is receiving the
data because i have employed this technique before, only previously i
did not need to receive the response.
$data = "POST /admin/default.asp HTTP/1.1\r\n";
$data .= etc etc etc
$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
$connection = socket_connect($socket,'(*IP ADDRESS*)','80');
Re: php socket question
Avoid using HTTP 1.1 - in my experience, PHP4 doesn't handle the chunked
transfer encoding very well. I don't know if they have sorted this out in
later versions though. The examples you are looking for are here:
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum