Forum Discussion

kazeem_yusuf1's avatar
kazeem_yusuf1
Icon for Nimbostratus rankNimbostratus
Jan 18, 2018

AN IRULE THAT INCLUDES ANOTHER PORT AS PART OF CONNECT METHOD PLUS 443

I'm using my LTM as transparent proxy for my users to get to the internet. How do i include a non-standard port in the CONNECT method list,apart from 443.

This is the current irule, i want to include another port, say 5057 to the list.

 First check to see what method we're handling through the proxy.
 We need to process CONNECT a little differently than other HTTP proxy
 methods, and we need to discard requests that come through with
 unsupported methods.
 Coming out of this section will be:
  - $host : hostname or bare IP address requested
  - $port : port of the connection requested
  - $new_path : normalized URI with the proxy format stripped
switch -- [HTTP::method] {
    "CONNECT" {
        set is_http 0
        set is_https 0
        set request_log_line ""
        set original_request [HTTP::uri]
        set host [string tolower [getfield [HTTP::uri] ":" 1]]
        set port [getfield [HTTP::uri] ":" 2]
        if {$port eq ""}{
            set port 443
        }
        set new_path [HTTP::uri]
        HTTP::header remove "Proxy-Connection"
        HTTP::cookie remove "MRHSession"
        if { $static::proxy_debug_L4_VIP_GPRS_TRANSPARENT } { log local0. "Connect request from $host to $port." }
        set http_version [HTTP::version]
        set is_connect 1
        set is_https 1
    }
No RepliesBe the first to reply