You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it's possible to set WS server URL after I create connection instance with autoConnect: false
import{io}from'socket.io-client';// create an instance without specified server URLconstconnection=io({autoConnect: false,reconnectionAttempts: 10,reconnectionDelay: 1,reconnectionDelayMax: 10,retries: 5,});// somehow obtain WS server URLconstserverURL=getServerURL();connection.setServerURL(serverURL);// this method does not existconnection.open();connection.on('connect',()=>{/* ... */});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi.
I would like to know if it's possible to set WS server URL after I create connection instance with
autoConnect: false
Beta Was this translation helpful? Give feedback.
All reactions