[FIG(quote)[
[FIGCAPTION[
[1] [CITE@en[Docker Remote API v1.19 - Docker]]
([TIME[2016-11-17 10:13:12 +09:00]])
<https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/>
]FIGCAPTION]

> Example request:
>  GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=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 }}

]FIG]


[FIG(quote)[
[FIGCAPTION[
[2] [CITE@en[Docker Remote API v1.19 - Docker]]
([TIME[2016-11-17 10:13:12 +09:00]])
<https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/>
]FIGCAPTION]

> 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 }}

]FIG]


[FIG(quote)[
[FIGCAPTION[
[3] [CITE@en[Docker Remote API v1.19 - Docker]]
([TIME[2016-11-17 10:13:12 +09:00]])
<https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/>
]FIGCAPTION]

> 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.

]FIG]
