### Constructor

# Soup WebsocketConnection new

#### Declaration [src]

    SoupWebsocketConnection*
    soup_websocket_connection_new (
      GIOStream* stream,
      GUri* uri,
      SoupWebsocketConnectionType type,
      const char* origin,
      const char* protocol,
      GList* extensions
    )

#### Description [src]

Creates a `SoupWebsocketConnection` on `stream` with the given active `extensions`.

This should be called after completing the handshake to begin using the WebSocket protocol.

#### Parameters

`stream`

  Type: `GIOStream`

  A `GIOStream` connected to the WebSocket server.

  The data is owned by the caller of the function.

`uri`

  Type: `GUri`

  The URI of the connection.

  The data is owned by the caller of the function.

`type`

  Type: `SoupWebsocketConnectionType`

  The type of connection (client/side)

`origin`

  Type: `const char*`

  The Origin of the client.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`protocol`

  Type: `const char*`

  The subprotocol in use.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`extensions`

  Type: A list of `None`

  A `GList` of `SoupWebsocketExtension` objects.

  The called function takes ownership of the data, and is responsible for freeing it.

#### Return value

Type: `SoupWebsocketConnection`

A new `SoupWebsocketConnection`.

The caller of the function takes ownership of the data, and is responsible for freeing it.