For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
Returns the best available WebSocket constructor for the current runtime.
try {
const WS = WebSocketFactory.getWebSocketConstructor()
const socket = new WS('wss://example.com/socket')
} catch (error) {
console.error('WebSocket not available in this environment.', error)
}