Contents

webSocketTask(with:)

Creates a WebSocket task for the provided URL.

Declaration

func webSocketTask(with url: URL) -> URLSessionWebSocketTask

Parameters

  • url:

    The WebSocket URL with which to connect.

Discussion

The provided URL must have a ws or wss scheme.

See Also

Adding WebSocket tasks to a session