honeynet / ochi

https://ochi.mushmush.org
GNU General Public License v3.0
25 stars 15 forks source link

Fix wss protocol #40

Closed dkumiszhan closed 1 year ago

dkumiszhan commented 1 year ago

new WebSocket() does not throw an error which the current logic seems to expect. Some background here.

We can handle it by adding onerror callback but choosing the protocol based on location.protocol seems to be cleaner.

Shanky0 commented 1 year ago

@dkumiszhan This is a great solution. Error was not getting caught in my case too, tried your solution and its working as expected.