()
| 1 | import { io } from 'socket.io-client'; |
| 2 | |
| 3 | export const initSocket = async () => { |
| 4 | const options = { |
| 5 | 'force new connection': true, |
| 6 | reconnectionAttempt: 'Infinity', |
| 7 | timeout: 10000, |
| 8 | transports: ['websocket'], |
| 9 | }; |
| 10 | return io(process.env.REACT_APP_BACKEND_URL, options); |
| 11 | }; |