how to only handle http connect method??

72 views
Skip to first unread message

Cuu Rothschild

unread,
Aug 14, 2016, 10:41:30 PM8/14/16
to goproxy-dev
I use example to setup a http connect method proxy or like "tcp proxy" with no ssl
just http connect method

but if had any extra headers like GET xxxx.com HTTP/1.0 or POST xxx.com 

eg:

CONNECT xtb3.id2015.cn:3389 HTTP/1.0
Host: example.site/ HTTP/1.1

then I always got 400 Bad request

Seems the goproxy still handle POST GET 
How to ignore the POST/GET headers when got CONNECT request on the first line??


I tested above lines under squid 
it works well 


Elazar Leibovich

unread,
Aug 14, 2016, 11:33:19 PM8/14/16
to Cuu Rothschild, goproxy-dev
IIRC the spec mandates two newlines after the CONNECT, so it should be something like

CONNECT foo HTTP/1.0

POST....

BTW I'm not sure how well golang's net/http is supporting HTTP/1.0

--
You received this message because you are subscribed to the Google Groups "goproxy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goproxy-dev+unsubscribe@googlegroups.com.
To post to this group, send email to gopro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/goproxy-dev/5907c677-f7f0-460f-ba5b-b56b13cf3a99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cuu Rothschild

unread,
Aug 15, 2016, 4:44:31 AM8/15/16
to goproxy-dev, dexte...@gmail.com
so there is no way to avoid  mandates two newlines after the CONNECT?
Where goproxy handle raw tcp connection data ? 
Maybe goproxy just filter the last line of the tcp data instead of the first line ,so I can change the rule


On Monday, August 15, 2016 at 11:33:19 AM UTC+8, Elazar Leibovich wrote:
IIRC the spec mandates two newlines after the CONNECT, so it should be something like

CONNECT foo HTTP/1.0

POST....

BTW I'm not sure how well golang's net/http is supporting HTTP/1.0
On Mon, Aug 15, 2016 at 5:41 AM, Cuu Rothschild <dexte...@gmail.com> wrote:
I use example to setup a http connect method proxy or like "tcp proxy" with no ssl
just http connect method

but if had any extra headers like GET xxxx.com HTTP/1.0 or POST xxx.com 

eg:

CONNECT xtb3.id2015.cn:3389 HTTP/1.0
Host: example.site/ HTTP/1.1

then I always got 400 Bad request

Seems the goproxy still handle POST GET 
How to ignore the POST/GET headers when got CONNECT request on the first line??


I tested above lines under squid 
it works well 


--
You received this message because you are subscribed to the Google Groups "goproxy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goproxy-dev...@googlegroups.com.

Cuu Rothschild

unread,
Aug 15, 2016, 4:45:25 AM8/15/16
to goproxy-dev, dexte...@gmail.com
so there is no way to avoid  mandates two newlines after the CONNECT?
Where goproxy handle raw tcp connection data ? 
Maybe goproxy just filter the last line of the tcp data instead of the first line ,so I can change the rule

On Monday, August 15, 2016 at 11:33:19 AM UTC+8, Elazar Leibovich wrote:
IIRC the spec mandates two newlines after the CONNECT, so it should be something like

CONNECT foo HTTP/1.0

POST....

BTW I'm not sure how well golang's net/http is supporting HTTP/1.0
On Mon, Aug 15, 2016 at 5:41 AM, Cuu Rothschild <dexte...@gmail.com> wrote:
I use example to setup a http connect method proxy or like "tcp proxy" with no ssl
just http connect method

but if had any extra headers like GET xxxx.com HTTP/1.0 or POST xxx.com 

eg:

CONNECT xtb3.id2015.cn:3389 HTTP/1.0
Host: example.site/ HTTP/1.1

then I always got 400 Bad request

Seems the goproxy still handle POST GET 
How to ignore the POST/GET headers when got CONNECT request on the first line??


I tested above lines under squid 
it works well 


--
You received this message because you are subscribed to the Google Groups "goproxy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goproxy-dev...@googlegroups.com.

Cuu Rothschild

unread,
Aug 15, 2016, 7:20:00 AM8/15/16
to goproxy-dev, dexte...@gmail.com
at last
I edited net/http in go 
server.go

comment out line 719
startswith

hosts, haveHost := req.Header["Host"]
 
ended on line 742 before the line of 

delete(req.Header, "Host")

then it woks... 
lol
Reply all
Reply to author
Forward
0 new messages