S
S
Sergey Druzhko2018-06-11 14:52:09
JavaScript
Sergey Druzhko, 2018-06-11 14:52:09

Why doesn't socket.io work on a domain?

212.86.108.252 - everything works fine here
https://bitcoinup.xyz/ - it doesn't work here
Code:

var socket = io.connect('ws://212.86.108.252:2020', {rememberTransport: false});

Everything does not work because of https. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Malyarov, 2018-06-11
@Konstantin18ko

var socket = io.connect('wss://212.86.108.252:2020', {rememberTransport: false});

Find the difference?
Change ws to wss .
Moreover, wss has an advantage .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question