tiws icon indicating copy to clipboard operation
tiws copied to clipboard

Headers

Open kgividen opened this issue 8 years ago • 2 comments

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.

kgividen avatar Jun 17 '16 23:06 kgividen

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'});

omorandi avatar Jul 07 '16 12:07 omorandi

Is this not implemented in android? WS.open(uri, ["some-protocol"], { header: 'my-header'});

reinisyed avatar Jul 16 '16 18:07 reinisyed