totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

websocket 'Allow' #613

Closed ivanlunardi closed 6 years ago

ivanlunardi commented 6 years ago

Hi, if i set multiple "host" in definition ex : F.websocket('/ws/message/{id}', socket_homepage,['json','http://127.0.0.1.xip.io:10001','http://www.google.com]); this piece of conde :

if (length) { if (allow.indexOf('*') === -1) { for (var i = 0; i < length; i++) { if (origin.indexOf(allow[i]) === -1) return false; } } }

in in WebSocketClient.prototype.prepare return false every time

Ivan

petersirka commented 6 years ago

I'm solving it...

petersirka commented 6 years ago

Hi @ivanlunardi, can you try latest beta version? $ npm install total.js@beta

ivanlunardi commented 6 years ago

i'm trying

ivanlunardi commented 6 years ago

now it works! thanks

petersirka commented 6 years ago

Great!

petersirka commented 6 years ago

Hi @ivanlunardi, I have published stable release 2.9.4 with this fix. $ npm install total.js