Search or ask Docker

Initialize interactive session

POST /session — Docker Engine API 1.57.

View Markdown
POST/session

Start a new interactive session with a server. Session allows server to call back to the client for advanced capabilities.

Deprecated: This endpoint is deprecated and will be removed in a future version. Server should support gRPC directly on the listening socket.

Hijacking

This endpoint hijacks the HTTP connection to HTTP2 transport that allows the client to expose gPRC services on that connection.

For example, the client sends this request to upgrade the connection:

POST /session HTTP/1.1
Upgrade: h2c
Connection: Upgrade

The Docker daemon responds with a 101 UPGRADED response follow with the raw stream:

HTTP/1.1 101 UPGRADED
Connection: Upgrade
Upgrade: h2c

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

No parameters are declared.

Request and responses

Response 101

no error, hijacking successful

application/vnd.docker.raw-stream

Response 400

bad parameter

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

Complete operation contract
{
  "description": "Start a new interactive session with a server. Session allows server to\ncall back to the client for advanced capabilities.\n\n\u003e **Deprecated**: This endpoint is deprecated and will be removed in a future version.\n\u003e Server should support gRPC directly on the listening socket.\n\n### Hijacking\n\nThis endpoint hijacks the HTTP connection to HTTP2 transport that allows\nthe client to expose gPRC services on that connection.\n\nFor example, the client sends this request to upgrade the connection:\n\n```\nPOST /session HTTP/1.1\nUpgrade: h2c\nConnection: Upgrade\n```\n\nThe Docker daemon responds with a `101 UPGRADED` response follow with\nthe raw stream:\n\n```\nHTTP/1.1 101 UPGRADED\nConnection: Upgrade\nUpgrade: h2c\n```\n",
  "operationId": "Session",
  "responses": {
    "101": {
      "content": {
        "application/vnd.docker.raw-stream": {}
      },
      "description": "no error, hijacking successful"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "bad parameter"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    }
  },
  "summary": "Initialize interactive session",
  "tags": [
    "Session"
  ]
}