Comments (5)
Hi @simathur, thanks for using goproxy.
When replying to a CONNECT request, the proxy is expected to create a tunnel. That is, to send any bytes sent to the proxy to the remote site, and send any bytes coming from the remote site back to the client.
So it cannot reuse the connection, and would not use any HTTP, 1.1, or 1.0.
Does that make sense, or am I misunderstanding the question?
from goproxy.
Thanks for the clarification, I understand conceptually. Though, I am still wondering what the following code block does in the ConnectAccept case block in handleHttps(). It does seem to be sending a HTTP 1.0 preamble to the upstream server, no?
ctx.Logf("Accepting CONNECT to %s", host)
proxyClient.Write([]byte("HTTP/1.0 200 OK\r\n\r\n"))
go copyAndClose(ctx, targetSiteCon, proxyClient)
go copyAndClose(ctx, proxyClient, targetSiteCon)
Thanks for your code and time!
from goproxy.
While the standard doesn't seem to mandate a particular HTTP version for the response[0], in practice I've seen that proxies use HTTP/1.0
, so I'm trying to stick with that. Here, have a look at squid proxy which have the HTTP/1.0
response hardwired in code.
[0]
5.3 Establishing a Tunnel with CONNECT
Any successful (2xx) response to a CONNECT request indicates that the
proxy has established a connection to the requested host and port,
and has switched to tunneling the current connection to that server
connection.It may be the case that the proxy itself can only reach the requested
origin server through another proxy. In this case, the first proxy
SHOULD make a CONNECT request of that next proxy, requesting a tunnel
to the authority. A proxy MUST NOT respond with any 2xx status code
unless it has either a direct or tunnel connection established to the
authority.
from goproxy.
Thanks for the explanation. BTW, do you hang around on IRC/#go-nuts sometimes? My nick is "simathur" when I am on IRC.
from goproxy.
Unfortunately I don't use IRC frequently. Should I?
On Wed, May 7, 2014 at 8:10 AM, simathur [email protected] wrote:
Thanks for the explanation. BTW, do you hang around on IRC/#go-nuts
sometimes? My nick is "simathur" when I am on IRC.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-42390114
.
from goproxy.
Related Issues (20)
- How best to modify HTTP data and header order
- https blocking does not take effect HOT 3
- goproxy v1.1 was discovered to contain an issue which can lead to Denial of Service (DoS) via unspecified vectors HOT 2
- Cannot connect to HTTP websocket when performing TLS MitM
- 请求头参数大小写格式在哪转换的?
- Semicolon in URL query HOT 1
- Potential Typo in Request Handling - "r.Close" misset to False?
- Question about modifying requests
- Can we do URL A -> proxy A, URL B -> proxy B?
- Limit the number of goroutines HOT 1
- Contant HOT 1
- team.works, with community support
- updating expired certificate
- NET::ERR_CERT_AUTHORITY_INVALID HOT 6
- Handle connect hijack & MITM at the same time not working HOT 2
- Core Functionality Broken HOT 6
- https only over ssh reverse proxy does not work HOT 1
- Http 3?
- MITM proxy option always uses HTTP/1.1 connection to client, can it use HTTP/2? HOT 1
- Is it possible to dump all incoming packets? I want to do packet analysis. I didn't see any code related to this. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goproxy.