Perl sockets and http posting
So I'm trying to create a perl script that opens a socket on port 5555 and my web browser (internet explorer) then connects to it and the perl script connects to another server which is defined in the script. Then outputs the data from the browser socket to the other socket and any data from the other socket to the browser socket. Basically a "go between". Here's my code:
Code:
#!/usr/bin/perl -w I tried sysread() to read the amount of bytes that the http request says the content length is. That didn't work....or maybe I didn't do it right. |
Quote:
With POE you not only get a lot of TCP stuff, you also get a full concurrent multitasking framework that's quite fun to use. I'd say that it's worthwhile to get into as you'll discover a lot of fun stuff. After that, doing a utility that watches for the presence of a file and send a TCP message when it appears is a snap to do and only requires a couple of lines of codes. Proxies, http servers, IRC servers, port forwarders, TCP servers/clients, job scheduling, are all regular POE tasks that are found in the POE cookbook. Check it out. |
Thanks for the info on POE. It might be what I need. Although what this script will be when it's finished is far away from the POE examples, they defiantly do provide me with a starting point.
But I'm still curious as to why I'm having the 'blocking' issue. It's driving me crazy. |
All times are GMT -5. The time now is 07:36 AM. |