Skip to content
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

Feature: add support for proxying http traffic (outbound) #483

Closed
davehorton opened this issue Oct 13, 2023 · 2 comments
Closed

Feature: add support for proxying http traffic (outbound) #483

davehorton opened this issue Oct 13, 2023 · 2 comments
Assignees

Comments

@davehorton
Copy link
Contributor

Several jambonz components need to reach out to the internet to connect to services, e.g.:

  • webhook / websocket requests (from unidici)
  • hosted tts
  • hosted stt

In some environments, it may be necessary to send all such traffic from jambonz through a customer-provided outbound proxy such as squid, nginx or similar. We should add support for two new env vars:

  • JAMBONES_HTTP_PROXY_IP
  • JAMBONES_HTTP_PROXY_PORT

If provided, then webhooks and websocket requests (outbound) should go through the proxy at the configured address. The proxy must be a passthru proxy (i.e. using the CONNECT method) so that it does not look like a man in the middle attack.

Also, as a first pass, Microsoft Azure TTS and STT, which support a proxy setting, should be able to route the traffic through this proxy as well.

@davehorton
Copy link
Contributor Author

@xquanluu please as a first thing work on making these env vars work for unidici so we can make webhook requests and send notifications through a global proxy, if configured.

See nodejs/undici#1650 for some discussion and details. It appears unidici does not directly support this out of the box, but it does support / expose a ProxyAgent class that can be used, and there is some sample code. Please test using squid.

@davehorton
Copy link
Contributor Author

sample code: nodejs/undici#1650 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants