Can we use socket socket.io-client as standalone on browser without having socket.io in server side #4886
Replies: 2 comments
-
https://stackoverflow.com/questions/19506735/client-side-socket-io-without-a-node-js-server this stackoverflow question suggests that server should also have used shocket io protocol my question how can we test that server is using socket io protocol Also can we use https://github.com/socketio/engine.io-client/ as stand alone |
Beta Was this translation helpful? Give feedback.
-
Hi! A Socket.IO server is indeed needed. Several implementations are available:
Reference: https://socket.io/docs/v4/#server-implementations The Socket.IO protocol is described there: https://socket.io/docs/v4/socket-io-protocol/ |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
We are implementing chat application where our backend is using gorilla golang
In UI can we use socket.io-client as standalone or do we need socket.io on server side as well
I am able to create a connection on UI but not able to send message
Events like io!.on('connection',) not working
socket.emit('request', /* … */); // not working
socket.on('reply', (event) => {
console.log("socket reply", event)
});
Above events are not working
What i suspect is socket-io is event based and we need socket io in backend also to receive these events in client
import { io } from "socket.io-client";
`
this.socket = io('url', {
path: '/',
transports: ["websocket"],
autoConnect: true,
// reconnectionDelayMax: 10000,
query: {
`
Beta Was this translation helpful? Give feedback.
All reactions