mkuklis / phonegap-websocket

Websocket PhoneGap plugin for Android
203 stars 78 forks source link

Support for Origin header #15

Closed rgillan closed 10 years ago

rgillan commented 10 years ago

An ability to pass through the Origin header as part of the constructor.

mkuklis commented 10 years ago

@rgillan Websocket constructor is now taking additional parameter called options (instead of protocol)

WebSocket(url, options)

You can use it to populate your headers and pass a draft:

var socket = WebSocket(URL, { headers: { origin: ORIGIN } , draft: "draft75" });

This is done currently only on the master branch (no phonegap 2.x.x support) yet. Could you give it a try and let me know if this works for you?