[**@tevm/jsonrpc**](../README.md) *** [@tevm/jsonrpc](../globals.md) / webSocket # Function: webSocket() > **webSocket**(`url?`, `config?`): `WebSocketTransport` Defined in: node\_modules/.pnpm/viem@2.49.3\_bufferutil@4.1.0\_typescript@6.0.3\_utf-8-validate@5.0.10\_zod@4.4.3/node\_modules/viem/\_types/clients/transports/webSocket.d.ts:70 ## Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `url?` | `string` | URL of the JSON-RPC API. Defaults to the chain's public RPC URL. | | `config?` | `WebSocketTransportConfig` | - | ## Returns `WebSocketTransport` ## Description Creates a WebSocket transport that connects to a JSON-RPC API.