problem description
java uses native code to write websocket,. I link through socket.io-client, and the service passes third-party tests, such as http://www.blue-zero.com/WebS.
, but the code just doesn"t link.
the environmental background of the problems and what methods you have tried
if you do not add transports: ["websocket"],
, the rotation training method used, do not report failed, but connect_error.
if you add it, you will report that the link has failed, and you will not be able to connect directly.
websocket.js:112 WebSocket connection to "ws://192.23.1.16:8080/api/webSocket/?EIO=3&transport=websocket" failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
webpackJsonp.2131.WS.doOpen @ websocket.js:112
OrderList.js:80 ******************connect_error ************ Error: websocket error
at WS.webpackJsonp.2113.Transport.onError (transport.js:64)
at WebSocket.ws.onerror (websocket.js:150)
related codes
const socket = io("ws://172.23.1.16:8080", {
path: "/seller/webSocket",
transports: ["websocket"],
})
// socket.open()
socket.on("connect", () => {
console.log("*********************connected")
})
socket.on("connect_error", err => {
console.log("******************connect_error ************", err)
})