I am a Korean developer.
I'm making a game and a game bot now.
Games run on WebGL and gamebots run on node JS.
There is a game git in the gamebot git. Because the game bot git has only scenario and is basically the same as normal game
The problem is, I'm using WebSocket in the code in this game git, but I imported the ws library because Node Js does not support WebSocket.
But,
import WebSocket from 'ws';
This code causes an error in the browser.
What should I do to use the websocket in both Nodejs and Browser with the same code?