toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

Difficulty Implementing Proxy for OpenAI API with App Calling and curl Insufficiency

Open albcm-simetrik opened this issue 2 years ago • 0 comments

Problem

I'm trying to create a proxy to communicate with the OpenAI API api.openai.com:443. The idea is to have the proxy running while the web service that uses the mentioned API is defining the OpenAI URL with the proxy "127.0.0.1:2269" to apply certain toxics.

The solution proposed in this comment works for me:

image

However, it is not applicable to my solution as it is an app that calls OpenAI, and curl is not sufficient. The alternative I'm trying to apply is to modify /etc/hosts as proposed in this comment within the service that calls the API.

image

However, I receive the following errors with these alternatives:

imageimage image

Also following this guide https://theholyjava.wordpress.com/2018/11/26/java-understanding-the-different-network-https-exceptions/ image

Any ideas?

albcm-simetrik avatar Nov 22 '23 21:11 albcm-simetrik