javascript - Unsuccessful connection to websocket using socket.io
三叔
三叔 2017-06-28 09:27:43
0
1
1189

websocket address:

ws://118.190.23.192:8081/websocket/weionwall/e26d78da-68d8-475d-8f41-d2bd1c5d4aff/false

If it is new WebSocket('address'), it will succeed.

It’s strange that the connection fails using socket.io JS.

var socket = io.connect('ws://118.190.23.192:8081/websocket/weionwall/e26d78da-68d8-475d-8f41-d2bd1c5d4aff/false')

socket.on('connect', data => {
    console.log(data);
})

This is the cdn I use

<script src="//cdn.bootcss.com/socket.io/2.0.3/socket.io.js"></script>

Why are you guys wrong? ?

三叔
三叔

reply all(1)
伊谢尔伦

Cross-domain, right? No 'Access-Control-Allow-Origin' header
Increasing cross-domain support in the http service is actually adding Access-Control-Allow-Origin in the http header

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!