Add HTTP proxy support for outbound WebSocket connections in websocket_client.conf (chan_websocket / ARI ExternalMedia)

I’m using the new chan_websocket driver (via ARI externalMedia with transport=websocket) to stream media from Asterisk to an external media server. My setup works fine in a direct-network scenario, but in production I need Asterisk to reach the external WebSocket server through a corporate HTTP CONNECT proxy.

After reading the res_websocket_client and chan_websocket documentation, I can’t find any proxy-related options in websocket_client.conf. The available options appear to be: uri, protocols, username, password, connection_type, connection_timeout, reconnect_interval, reconnect_attempts, tls_enabled, ca_list_file, verify_server_cert, verify_server_hostname.

My environment:

  • Asterisk version: [fill in, e.g. 22.8.0]

  • Use case: ARI externalMedia with transport: "websocket", connection_type: "client", streaming audio to a cloud media server

  • Outbound network policy: all external HTTPS/WSS must go through http://corporate-proxy:8080 (HTTP CONNECT)

Hmmm. Not currently supported but probably should have been. Open an “Improvement” issue at Issues · asterisk/asterisk · GitHub and I’ll take a look.

@gjoseph [improvement]: Add HTTP proxy support for outbound WebSocket connections in websocket_client.conf (chan_websocket / ARI ExternalMedia) · Issue #1881 · asterisk/asterisk · GitHub
Raise the improvement

Yep, I saw it and am evaluating. It’s not going to be a trivial effort to implement however so I can’t give you a timeframe.

Ok sure