chobits / ngx_http_proxy_connect_module

A forward proxy module for CONNECT request handling
BSD 2-Clause "Simplified" License
1.85k stars 498 forks source link

Can I ask you something about CONNECT method? #293

Closed soosue closed 2 months ago

soosue commented 11 months ago

I need to using proxy server(NGINX) to request(HTTPS protocol) A server. And I implement the java code. (I'm not using this module not yet.)

I guess that when I request https protocol to proxy server, it first using CONNECT to A server. and if its return is 200 then send real request(ex. POST).

is it right?

and another question. If the assumption is correct, is it impossible to request server A using proxy if server A has not implemented CONNECT?

I think there will be a lot of servers that don't implement CONNECT. What this module does is if the server doesn't implement CONNECT, does it also return 200 responses?

I would appreciate your help. :)

chobits commented 9 months ago

I need to using proxy server(NGINX) to request(HTTPS protocol) A server. And I implement the java code. (I'm not using this module not yet.)

I guess that when I request https protocol to proxy server, it first using CONNECT to A server. and if its return is 200 then send real request(ex. POST).

is it right?

No, here is the detail of this progress, you could check it.

when you request to the first server (proxy server(NGINX) in your description), you (or your client, such as curl command) send the CONNECT request firstly, then the first server send https request to backend server (A server).

and another question. If the assumption is correct, is it impossible to request server A using proxy if server A has not implemented CONNECT?

I think there will be a lot of servers that don't implement CONNECT. What this module does is if the server doesn't implement CONNECT, does it also return 200 responses?

I would appreciate your help. :)