Forum Discussion
rexmcordero_144
Nimbostratus
Sep 29, 2015Return a page when a port is accessed
Hi,
I want to create an iRule that if a specific port is accessed, it will return a page like "You used port 143, please use 8080".
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 1...
Lucas_Thompson_
Sep 29, 2015Historic F5 Account
You're 99% there. Just have to remember that you're not in HTTP yet. CLIENT_ACCEPTED happens in TCP, so you have to use TCP::respond instead of HTTP::respond. You can also send a response and close the connection before the client has actually transmitted the request, it's tolerated OK. For example:
TCP::respond "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\nPlease connect to port 8080 instead of port [TCP::local_port]"
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