Connect to websoket server from worker

I am trying to connect to a remote websocket server from the worker, so worker is the websocket client and remote websocket is the server.

/*socket.onopen = () => {
				// Send a message to the server
				console.log('WebSocket connection :' )
				socket.send('Hello, world!');
			  };
			
			
			socket.addEventListener('open', (event) => {
				console.log('WebSocket connection established!..');
			  });

i tested multiple websoket server but return {}
no connection established.