Skip to content

Commit

Permalink
Merge pull request #192 from similarweb/fix/sockets-config-base
Browse files Browse the repository at this point in the history
Solving: code: 1 message: "Session ID unknown" with multiple client i…
  • Loading branch information
kaplanelad authored Mar 4, 2020
2 parents f8f0190 + 616f7f2 commit be9814d
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 be9814d

Please sign in to comment.