Can I use WebSocket in Worker to connect to a 3rd party server?

I need to connect to an existing ws server from my worker.
When I use WebSocket it throws error that constructor is not implemented. I found WebSocketPair factory method in docs, but it cannot be configured to use custom uri.

Is it even possible to connect to other websocket server now?