Closed Bug 1240131 Opened 10 years ago Closed 10 years ago

HTTP Proxy for TURN only works when specified by IP address

Categories

(Core :: WebRTC: Networking, defect)

45 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1237299

People

(Reporter: byron, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.79 Safari/537.36 Steps to reproduce: 1. Configure a TCP TURN server on $TURN_IP:3478 2. Configure Firefox to use proxyserver.example.com:3128 for all protocols. 3. Create an RTCPeerConnection using the TURN server created above. 4. Use the RTCPeerConnection to create an offer. Actual results: Firefox makes no CONNECT request to proxyserver.example.com:3128 for $TURN_IP:3478. All other traffic is successfully passed to the proxy. In the log there are a series of messages like this: 2752512[101830bc0]: (generic/ERR) Could not invoke DNS resolver 2752512[101830bc0]: (generic/ERR) Could not invoke DNS resolver Expected results: Firefox should have made a request like this to proxyserver.example.com:3128: CONNECT $TURN_IP:3478 HTTP/1.0
When the proxy server is specified by IP address, the TURN connection is tunneled through the proxy as expected.
This code in media/mtransport/nricectx.cpp appears to handle this case: > nsresult NrIceCtx::SetResolver(nr_resolver *resolver) { > int r = nr_ice_ctx_set_resolver(ctx_, resolver); > > if (r) { > MOZ_MTLOG(ML_ERROR, "Couldn't set resolver for '" << name_ << "'"); > return NS_ERROR_FAILURE; > } > > return NS_OK; > } > > nsresult NrIceCtx::SetProxyServer(const NrIceProxyServer& proxy_server) { > int r,_status; > nr_proxy_tunnel_config *config = nullptr; > nr_socket_wrapper_factory *wrapper = nullptr; > > if ((r = nr_proxy_tunnel_config_create(&config))) { > ABORT(r); > } > > if ((r = nr_proxy_tunnel_config_set_proxy(config, > proxy_server.host().c_str(), > proxy_server.port()))) { > ABORT(r); > } > > if ((r = nr_proxy_tunnel_config_set_resolver(config, ctx_->resolver))) { > ABORT(r); > } > > if ((r = nr_socket_wrapper_factory_proxy_tunnel_create(config, &wrapper))) { > MOZ_MTLOG(LogLevel::Error, "Couldn't create proxy tunnel wrapper."); > ABORT(r); > } > > // nr_ice_ctx will own the wrapper after this call > if ((r = nr_ice_ctx_set_turn_tcp_socket_wrapper(ctx_, wrapper))) { > MOZ_MTLOG(ML_ERROR, "Couldn't set proxy for '" << name_ << "': " << r); > ABORT(r); > } > > _status = 0; > abort: > nr_proxy_tunnel_config_destroy(&config); > if (_status) { > nr_socket_wrapper_factory_destroy(&wrapper); > return NS_ERROR_FAILURE; > } > return NS_OK; > } The only problem is that NrIceCtx::SetResolver is *never* called so the code will only work for proxy servers specified by address.
Can you try two things: 1) Does it work with Firefox 41 (you can still download it from here https://ftp.mozilla.org/pub/firefox/releases/41.0/)? 2) Does it work with the latest Nightly build (https://nightly.mozilla.org/)? Very much sounds like a dupe of bug 1237299.
See Also: → 1237299
Sorry for the noise. It does work correctly with both 41 and the latest nightly. I tested previously with 45 (Developer edition) and it appears to still be broken there. Any chance of the fix getting pulled back to 45 so that it ships with the next ESR?
No worries, it always better to report something twice. Thanks for testing it so quickly. The bug got introduced in 42. Luckily the fix for bug 1237299 just landed in 46 and also got already uplifted to 45 (and should get included in the next build of 45).
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.