lua-resty-requests icon indicating copy to clipboard operation
lua-resty-requests copied to clipboard

Proxy auth

Open marcoroganovic opened this issue 4 years ago • 5 comments

Hello, thanks for the convenient library. I have one question regarding proxy usage, can I pass authentication for a proxy?

marcoroganovic avatar Nov 07 '20 11:11 marcoroganovic

@marcoroganovic Sorry i'm afraid that i don't understand your mean. Could you give me an example? Or i guess you are saying the Authorization header?

tokers avatar Nov 07 '20 13:11 tokers

@tokers Hey, thanks for replying.

Basically, I need to do next:

  1. Connect domain to some VPS
  2. On that domain setup OpenResty configs
  3. Once someone hits those domains I need to set headers like host, authorization, user-agent
  4. And then to forward that request through some dedicated proxy in order to not show servers IP

marcoroganovic avatar Nov 07 '20 14:11 marcoroganovic

@tokers Hi, any opinion on this?

marcoroganovic avatar Nov 08 '20 08:11 marcoroganovic

In my opinion, the process of authorization is not bound with lua-resty-requests, you can prepare these authorization related headers first and use them when calling methods provided by this library.

tokers avatar Nov 08 '20 09:11 tokers

@tokers

What I'm making is a small crawler and I need to change IP addresses, to avoid certain limits on a single IP, can this client library be used like that?

marcoroganovic avatar Nov 15 '20 13:11 marcoroganovic