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 ...
Martin_Machacek
Jan 10, 2007Historic F5 Account
Stephan,
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
