Example request:
GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
Example response:
HTTP/1.1 101 UPGRADED
Content-Type: application/vnd.docker.raw-stream
Connection: Upgrade
Upgrade: tcp
{{ STREAM }}
Example request:
POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
Example response:
HTTP/1.1 101 UPGRADED
Content-Type: application/vnd.docker.raw-stream
Connection: Upgrade
Upgrade: tcp
{{ STREAM }}
In this version of the API, /attach, uses hijacking to transport stdin, stdout, and stderr on the same socket.
To hint potential proxies about connection hijacking, Docker client sends connection upgrade headers similarly to websocket.
Upgrade: tcp
Connection: Upgrade
When Docker daemon detects the Upgrade header, it switches its status code from 200 OK to 101 UPGRADED and resends the same headers.