lancecarlson/openai.cr

Support for http proxy.

Closed this issue · 6 comments

I would like to see support for http proxy...

crystal-lang/crystal#2963
https://github.com/mamantoha/http_proxy

@kojix2 As I don't personally have a use case for this, do you have a good way I can simulate this locally to test out and make sure I got it working?

The motivation behind this is a bit difficult to express.
It feels like it takes a bit of courage to talk about that.

Not just in Japan where I live, but also in companies and groups worldwide, it's common to have an inside HTTP proxy server to control internet access. Additionally, due to internal rules, uploading personal information, secret data, codes, and similar stuff to ChatGPT is strictly not allowed. Even in those cases, you might access ChatGPT through an HTTP proxy from a regular browser, but using command-line tools would also need the proxy.

I think there's a significant practical need for this kind of access. I personally use ChatGPT through an HTTP proxy server. However, expressing this demand can be tough, even if the usage strictly adheres to organizational rules. (It's important to use ChatGPT in compliance with the rules.)

I'm not an expert in networks, but I'd like to help with testing and troubleshooting as much as I can.

@kojix2 Sorry, I assumed that was the use case. What I was more asking for was what specific proxy service do you use? I suppose I can just sign up for ones here I use, but I was curious if you had any you would recommend.

@lancecarlson
I honestly don't know much about it, so I don't have a recommendation. Sorry.

When I actually tried openai.cr through the proxy, it seemed to work without anychanges to openai.cr because http_proxy extends the existing HTTP::Client class.
I should have tried my hand first instead of chatting. 🤦

Thanks. Have a good days!

Thank you for testing this out!! I'm so glad it works as is