# Uses of Interface
java.net.http.WebSocket.Builder

Packages that use WebSocket.Builder
Package
Description
java.net.http
HTTP Client and WebSocket APIs

## Uses of WebSocket.Builder in java.net.http

Methods in java.net.http that return WebSocket.Builder
Modifier and Type
Method
Description
`WebSocket.Builder`
WebSocket.Builder.`connectTimeout(Duration timeout)`
Sets a timeout for establishing a WebSocket connection.
`WebSocket.Builder`
WebSocket.Builder.`header(String name, String value)`
Adds the given name-value pair to the list of additional HTTP headers sent during the opening handshake.
`WebSocket.Builder`
HttpClient.`newWebSocketBuilder()`
Creates a new `WebSocket` builder (optional operation).
`WebSocket.Builder`
WebSocket.Builder.`subprotocols(String mostPreferred, String... lesserPreferred)`
Sets a request for the given subprotocols.