WebSocket client not working over proxy

Aug 18, 2015 at 5:30 PM
Has anyone run into an issue with the C++ REST SDK websocket client not working in proxied environment?

Running the following code:
web::websockets::client::websocket_client_config myConfig;
myConfig.set_proxy(web::web_proxy(web::web_proxy::use_auto_discovery));
web::websockets::client::websocket_client myClient(myConfig);
try
{
    myClient.connect(L"wss://echo.websocket.org").get();
}
catch (web::websockets::client::websocket_exception e)
{...}
Gives me an exception: "set_fail_handler: 9: Timer Expired"

If I replace the 2nd line with the actual proxy address, e.g.
myConfig.set_proxy(web::web_proxy(web::uri(L"http://<myproxyaddr>:<port>")));
Then everything works fine. So, the use_auto_proxy_discovery mode does not appear to be working.
Coordinator
Sep 4, 2015 at 12:56 AM
hey abashmak

In our Websocket client, we only support user specified proxies. Auto discovery is not supported.
Reason being, the Websocket++ library, on top of which the Casablanca websocket client is built, supports explicit outgoing proxies.

Thanks
Kavya
Sep 24, 2015 at 11:16 PM
Thank you kavyako for the response. It now makes sense why it's not working. A couple of follow on questions:
  1. How come the web_proxy::use_auto_discovery option is provide if it's not supported?
  2. Are you aware of any other websocket clients that support auto discovery?
Coordinator
Sep 24, 2015 at 11:44 PM
All our libraries (http, websockets) use the same proxy interfaces, hence you see that option. It should be possible to fix that by either not exposing that option or throwing an appropriate error. Feel free to open an issue.
I don't have much hands on experience with other websocket clients to answer your second question.

Thanks
Kavya