tkf / emacs-request

Request.el -- Easy HTTP request for Emacs Lisp
http://tkf.github.com/emacs-request/
GNU General Public License v3.0
629 stars 93 forks source link

Cannt handle https sites with F5 BIG-IP's Explicit proxy #213

Closed ysjj closed 2 years ago

ysjj commented 2 years ago

For the reason phrase of 'HTTP/1.[01] 200' response to CONNECT method, most proxies use 'Connection established', but a few use 'Connected'.

One specific example is F5 BIG-IP's Explict proxy.

See: https://community.f5.com/t5/technical-articles/http-explicit-proxy-explained-in-plain-english/ta-p/280853#toc-hId-842630538

If request is HTTPS instead of HTTP, things are slightly different. First, Firefox (my browser) tries to establish an HTTP tunnel (using CONNECT HTTP method) to https://server2.rodrigo.example/, BIG-IP then immediately establishes TCP connection with remote-destination (after DNS lookup of course!). Lastly, once TCP connection is established with remote-destination, BIG-IP responds (to client) with 200 Connected signalling tunnel is successfully established and BIG-IP is ready to forward any requests through recently established tunnel: image

The current 'request.el' expects the fixed phrase 'Connection established', which does not work well with F5 BIG-IP's Explicit proxy for https sites.

Perhaps, "HTTP/1\.[0-1] 200 Connect" is sufficient as a match pattern in the request--consume-200-connection-established. https://github.com/tkf/emacs-request/blob/bb277bc25efe546bceef8a98d9f55b4e32b46d5f/request.el#L1058-L1061