Forum Discussion
Stephan_Fantasi
Nimbostratus
Nov 27, 2006Rule based virtual server hangs during direct socket connections
I am trying to create a rule based virtual host that will direct traffic to one machine or another depending on http_uri. This seems to work fine for general browser access. And, it works fine when I test it via "telnet hostname 80". However, it just hangs when I use a perl script that opens a socket to port 80. Please see http://www.oreilly.com/openbook/webclient/ch04.html16761to see exactly what I am using. This works perfectly fine when I use it access a non rule-based host. But it hangs for the rule-based. Have any of you been able to access a rule-based virtual host via a direct socket connection without issue? I'm not doing anything fancy. This just isn't working.
Thanks,
Steve
2 Replies
- Colin_Walker_12Historic F5 AccountThat's definitely an interesting situation. I haven't tested this personally, but if the telnet connection works, and general browser access works, then the perl script must be doing something at least slightly different and/or out of the ordinary. Perhaps it's waiting for some response that's not being sent by the proxy?
Very interesting. I'd love to hear about it if you find out more.
Colin - Martin_MachacekHistoric F5 AccountStephan,
your Perl based web client is most likely sending just linefeed characters (\n - hex 0a) instead of carriage return, linefeed sequences (\r\n - hex 0d,0a) as line terminators as is mandated by applicable RFCs (2616, 1945). BIG-IP HTTP parser used by the iRule engine requires lines to be terminated by carriage return, linefeed sequences. All normal web clients DoTheRightThing(tm). Also Unix/Linux bases TELNET clients by default translate \n to \r\n. The example you've refered to clearly uses only \n as line terminator:contact the server if (open_TCP(F, $ARGV[0], 80) == undef) { print "Error connecting to server at $ARGV[0]\n"; exit(-1); } send the GET method with / as a parameter print F "GET / HTTP/1.0\n\n";
Unless there is some behind-the-scenes translation, that is your problem. It can be trivially fixed by prefixing every \n with \r, like this:contact the server send the GET method with / as a parameter print F "GET / HTTP/1.0\r\n\r\n";
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
