-
Notifications
You must be signed in to change notification settings - Fork 388
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
Please add support to HTTP proxy #22
Comments
I guess it would be possible to handle HTTP proxies in gawk, though it was not implemented yet. For HTTPS: one possible solution is to create a gawk binding of any existing SSL/TLS library (e.g. OpenSSL). Compared to "modern" scripting languages like Python and Ruby (which have almost everything in their standard libraries), that is indeed more difficult. Using cURL to replace gawk's network layer is a more viable solution and it's on the future plan. |
I just read your source code. It seems that you manage TCP connections manually. Just see these HTTP headers:
With proxy:
The proxy support can be implemented at BTW, how do you use translate-shell in China? |
@m13253 That's not correct. The actual request is url = HttpProtocol HttpHost "/translate_a/t?client=t" \
"&ie=UTF-8&oe=UTF-8" \
"&text=" preprocess(text) "&sl=" sl "&tl=" tl "&hl=" hl
print "GET " url |& HttpService The problem is that gawk isn't aware of proxy. Not that only HTTP request line matters. FYI. I don't use it in China since I don't live in China. Is |
I can not establish a direct connection to translate.google.com:80, so I need to use a HTTP proxy.
Could you please add support to HTTP proxy? Either by using
$http_proxy
or by specifying--proxy
in command line.By the way, is it difficult to use HTTPS instead of HTTP? I think it may be more secure.
Thanks.
The text was updated successfully, but these errors were encountered: