Skip to content

Commit

Permalink
Solving: code: 1 message: "Session ID unknown" with multiple client i…
Browse files Browse the repository at this point in the history
…nstances. (applied to all socket connections.)
  • Loading branch information
garciamax committed Mar 4, 2020
1 parent f8f0190 commit 616f7f2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ui/client/src/context/SocketIOContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@ const endpoint = process.env.NODE_ENV === 'development' ? 'localhost:5000' : '';


const SocketIOContext = React.createContext({});

const baseSocketConfig = {
transports: ['websocket'],
secure: true,
path: '/api/socket',
};
const SocketIOProvider = ({ children, io }) => {
const deploymentDetails = io(`${endpoint}/deployment-details`, {
path: '/api/socket',
transports: ['websocket'],
secure: true,
...baseSocketConfig,
});

const applications = io(`${endpoint}/applications`, {
path: '/api/socket',
...baseSocketConfig,
});

const metrics = io(`${endpoint}/metrics`, {
path: '/api/socket',
...baseSocketConfig,
});

const alerts = io(`${endpoint}/alerts`, {
path: '/api/socket',
...baseSocketConfig,
});

const value = useMemo(() => ({
Expand Down

0 comments on commit 616f7f2

Please sign in to comment.