Closed kulame closed 2 years ago
hi i want to convert a http reqeust to a sockaddr like the golang hijack. https://pkg.go.dev/net/http#Hijacker
i try to follow the example https://github.com/hyperium/hyper/blob/master/examples/http_proxy.rs but failed.
because the uri.authority() is None. how can I fetch the addr from req with the uri.authority() is None?
Depends if the client sent a request with the address in URI or not. Many are just GET / HTTP/1.1, so then you need to check the host header instead, if it is sent.
GET / HTTP/1.1
hi i want to convert a http reqeust to a sockaddr like the golang hijack. https://pkg.go.dev/net/http#Hijacker
i try to follow the example https://github.com/hyperium/hyper/blob/master/examples/http_proxy.rs
but failed.
because the uri.authority() is None. how can I fetch the addr from req with the uri.authority() is None?