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

Proxy autodetection doesn't work with websockets/SignalR #214

Open
ruben-ivre opened this issue Dec 4, 2024 · 5 comments
Open

Proxy autodetection doesn't work with websockets/SignalR #214

ruben-ivre opened this issue Dec 4, 2024 · 5 comments

Comments

@ruben-ivre
Copy link

ruben-ivre commented Dec 4, 2024

When using websockets (SignalR in my case) the proxy autodetection doesn't work, as in the proxy is never detected.
I think it doesn't run at all, as I added a breakpoint in ProxyDetector.OnRequestEvent and it didn't trigger.
The logs from that event doesn't appear either. websockets-proxy-autodetect.log

My guess is that something in the websockets request is different and that Resend event is never used.

For now, I'm running the proxy detectors manually and setting the proxy if so, which works perfectly fine.

@Benedicht
Copy link
Owner

at Proxies.Autodetect.ProxyDetector.Detach () [0x00001] in ProxyDetector.cs:96
at Shared.HTTPManager.set_ProxyDetector (Proxies.Autodetect.ProxyDetector value) [0x00001] in HTTPManager.cs:80
at Engage.Websockets.BestHttpSignalRClient.Connect (System.String url, System.String userToken, System.Action subscribeEventsCallbacks) [0x0004d] in BestHttpSignalRClient.cs:37

There were a call to set a new ProxyDetector from BestHttpSignalRClient.cs:37. What was the new value? A null value effectively disables proxy detection.

@ruben-ivre
Copy link
Author

at Proxies.Autodetect.ProxyDetector.Detach () [0x00001] in ProxyDetector.cs:96
at Shared.HTTPManager.set_ProxyDetector (Proxies.Autodetect.ProxyDetector value) [0x00001] in HTTPManager.cs:80
at Engage.Websockets.BestHttpSignalRClient.Connect (System.String url, System.String userToken, System.Action subscribeEventsCallbacks) [0x0004d] in BestHttpSignalRClient.cs:37

There were a call to set a new ProxyDetector from BestHttpSignalRClient.cs:37. What was the new value? A null value effectively disables proxy detection.

BestHttpSignalRClient.cs:37 is HTTPManager.ProxyDetector = new Best.HTTP.Proxies.Autodetect.ProxyDetector();

We set it every time before connecting. We also tried doing it only once but didn't make any difference.

@Benedicht
Copy link
Owner

Hmm, i'm going to check it. However, is there a reason you set it manually? The plugin already setting it to a ProxyDetector instance in its private static constructor. You should only set it if you want to costumize or disable it.

@ruben-ivre
Copy link
Author

Hmm, i'm going to check it. However, is there a reason you set it manually? The plugin already setting it to a ProxyDetector instance in its private static constructor. You should only set it if you want to costumize or disable it.

Oh, no particular reason, I thought it was necessary, documentation says you need to do it: https://bestdocshub.pages.dev/Shared/proxy/proxy-autodetect/

@Benedicht
Copy link
Owner

Ohh, i think i copy-pasted from the old documentation for v2, and i might enabled it by default in v3...
I'm going to update the documentation as well.

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