tiws
tiws copied to clipboard
Headers
If I need to pass in headers at the same time as the ws information is there a way to do that? I can do it in this lib for nodejs https://github.com/websockets/ws this way:
var url = 'ws://' + auth + '@' + host + '/rest/subscribe';
var ws = new WebSocket(url, 'ISYSUB', {
origin: 'blah',
protocolVersion: 13
});
ws.on('message', function message(data, flags) {
console.log(data);
;
but I need to do it for a titanium app.
you can pass a dictionary with your custom headers as a third parameter of the open() method:
WS.open(uri, ["some-protocol"], { header: 'my-header'});
Is this not implemented in android? WS.open(uri, ["some-protocol"], { header: 'my-header'});