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

How to stream data through an HTTP Proxy? #78

Open
helenweng-stripe opened this issue Mar 28, 2019 · 1 comment
Open

How to stream data through an HTTP Proxy? #78

helenweng-stripe opened this issue Mar 28, 2019 · 1 comment

Comments

@helenweng-stripe
Copy link

Hi! I want to send requests through an HTTP proxy. This behavior is available in the ruby module (https://github.com/signalfx/signalfx-ruby) by setting the http_proxy environment variables, but I tested it for this module, and it doesn't seem to work. I want to guess it is because the internal library used to send requests is urllib3, which doesn't support proxying, but I am hoping I am wrong? Is there a way to send requests through an HTTP proxy?

For context, I am using SignalFlow. The code I am running is below:

import signalfx
with signalfx.SignalFx().signalflow(ACCESS_TOKEN) as flow:
            computation = flow.execute(program, start=start, stop=stop, resolution=resolution)

Thank you for the help!

@mpetazzoni
Copy link
Contributor

Unfortunately the SignalFlow client in signalfx-python does not support proxies at this time.

ws4py used by the WebSocket transport (the default, also the most optimized and efficient) does not support proxies. We could apparently make the SSE/urllib3-based transport to work with proxies though by using proxy_from_url() at https://github.com/signalfx/signalfx-python/blob/master/signalfx/signalflow/sse.py#L46 when an HTTP proxy URL is passed in. The SSE transport is less efficient, and requires one connection per SignalFlow program, but for simple use cases it could be sufficient; depends on your situation here really.

Would you be able to send a PR that implements this?

@mpetazzoni mpetazzoni changed the title How to send data through an HTTP Proxy? How to stream data through an HTTP Proxy? Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants