-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added host name parsing from the client, so that a hostname, rather t… #71
base: master
Are you sure you want to change the base?
Conversation
…han an IP address will be sent in http-connect. This can be expanded for the other types of relays. In order to use the feature, one should add the directive 'parse_host' to the configuration file. Its value can be either "sni" or "http_host". For "sni", the client is expected to send an SSL client hello with the SNI extenion containing the server name. For "http_host" the clien is expected to send an HTTP request with the Host header. If the hostname is received, it will be placed (including the port to which the connection was intended) in the CONNECT method that is sent to the proxy.
I'd like to 'second' this pull request. Can be very helpful with Squid ACLs based on hostnames (Google Cloud Platform for example). |
for using hostnames to connect through proxies See darkk#71 Change-Id: I62140e1d40dc74427721c46272fba23c1dd1ea74
This patch does seem to break any requests going to an IP instead of hostname.
The latter never ends up at the proxyserver. |
7fa694d
to
5df6a30
Compare
Any update on this? I've been using Redsocks for a while now and I'm beginning to notice several websites stop working (just certificate errors) because they are requiring SNI. |
Sorry, I had rebuilt redsocks without this patch, then it still didn't work, so that it's more likely to be related to my OS, rather than this patch. Update: after applying libevent-2.1-compat.patch, redsocks seems to be working. Same as #123 |
|
||
memset(temp_hostname, 0, parser_data.http_host_length + 1); | ||
memcpy(temp_hostname, parser_data.http_host, parser_data.http_host_length); | ||
temp_hostname[parser_data.http_host_length + 1] = '\0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out-of-bounds?
…han an IP
address will be sent in http-connect. This can be expanded for the other types
of relays.
In order to use the feature, one should add the directive 'parse_host' to the
configuration file. Its value can be either "sni" or "http_host".
For "sni", the client is expected to send an SSL client hello with the SNI
extenion containing the server name.
For "http_host" the clien is expected to send an HTTP request with the Host
header.
If the hostname is received, it will be placed (including the port to which
the connection was intended) in the CONNECT method that is sent to the proxy.