Looks like it\'s easy to add custom HTTP headers to your websocket client with any HTTP header client which supports this, but I can\'t find how to do it with the JSON API.
Technically, you will be sending these headers through the connect function before the protocol upgrade phase. This worked for me in a nodejs project:
nodejs
var WebSocketClient = require('websocket').client; var ws = new WebSocketClient(); ws.connect(url, '', headers);