lua-requests
lua-requests copied to clipboard
SSL / Proxy requests
Is there anyway to make get requests via this codebase using a proxy for https urls? Currently getting "proxy not supported"
Changing line 102 to local socket = string.find(full_request.url, '^https:') and not request.proxy and https_socket or http_socket sent the proxy through socket.http and fixed the issue.
Good catch. I made the fix and uploaded a new luarock.
hmm. even with that, I noticed that I am getting <head><title>400 The plain HTTP request was sent to HTTPS port</title></head> using a proxy with the http transport on nginx sites (the ones I need). Any ideas. This is the closest thing I have found to working in lua for now. It needs a solid http/https library badly.
Yeah unfortunately it looks like this isn't possible using LuaSec and LuaSocket how they currently are. Have you tried using the lua curl bindings? I know cURL supports different proxies pretty well so that might be able to do it. I have been considering trying it out for this library instead of LuaSec and LuaSocket because cURL has so many more features.