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
The API Gateway starts properly, but it seems that new connections are been spawned:
[2021-10-25T01:31:08.367Z] INFO mac-mini.localdomain-63071/LIBRARYSOCKET: (nsp:'/') Client connected: ud--MOhsrOxHYjtKABTpnamespace middleware[2021-10-25T01:31:13.374Z] INFO mac-mini.localdomain-63071/LIBRARYSOCKET: (nsp:'/') Client connected: BVrLP7wGn6ra3ku2ABTqnamespace middleware[2021-10-25T01:31:18.380Z] INFO mac-mini.localdomain-63071/LIBRARYSOCKET: (nsp:'/') Client connected: 8A5oSA0xkubgVf9yABTr
For what its worth, my React client has this code:
importReact,{createContext,ReactElement}from"react";importio,{Socket}from"socket.io-client";import{SOCKET_BASE_URI}from"../../constants/endpoints";import{useDispatch}from"react-redux";import{RMQ_SOCKET_CONNECTED}from"../../constants/action-types";import{success}from"react-notification-system-redux";constWebSocketContext=createContext(null);exportconstWebSocketProvider=({ children }): ReactElement=>{constdispatch=useDispatch();constsocket: Socket=io(SOCKET_BASE_URI);socket.on("connect",()=>{console.log("connected");// <-- this never firesdispatch({type: RMQ_SOCKET_CONNECTED,isSocketConnected: true,socketId: socket.id,});});socket.on("disconnect",()=>{console.log(`disconnect`);});constws: any={
socket,};return(<WebSocketContext.Providervalue={ws}>{children}</WebSocketContext.Provider>);};export{WebSocketContext};exportdefaultWebSocketProvider;
The socket never connects from the client, and socket.on("connect"... never seems to succeed.
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
Hello, I am using the moleculer-template-project-typescript for my services. I do have a socket.io service based off of this example.
Here's the relevant code in the server:
The API Gateway starts properly, but it seems that new connections are been spawned:
For what its worth, my React client has this code:
The socket never connects from the client, and
socket.on("connect"...
never seems to succeed.What am I doing wrong?
The text was updated successfully, but these errors were encountered: