mirror of https://github.com/docker/docs.git
Websockets info
This commit is contained in:
parent
4fb3f2f18b
commit
6334298bc4
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
title: Websockets
|
title: Websockets
|
||||||
description: Learn how to use websocket in your swarm services when using the
|
description: Learn how to use websockets in your swarm services when using the
|
||||||
layer 7 routing solution for UCP.
|
layer 7 routing solution for UCP.
|
||||||
keywords: routing, proxy
|
keywords: routing, proxy
|
||||||
---
|
---
|
||||||
|
|
||||||
In this example we will publish a service and configure support for websockets.
|
# Using websockets
|
||||||
|
|
||||||
First we will create an overlay network so that service traffic is isolated and secure:
|
First, create an overlay network to isolate and secure service traffic:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$> docker network create -d overlay demo
|
$> docker network create -d overlay demo
|
||||||
1se1glh749q1i4pw0kf26mfx5
|
1se1glh749q1i4pw0kf26mfx5
|
||||||
```
|
```
|
||||||
|
|
||||||
Next we will create the service with websocket endpoints:
|
Next, create the service with websocket endpoints:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$> docker service create \
|
$> docker service create \
|
||||||
|
|
@ -27,10 +27,9 @@ $> docker service create \
|
||||||
ehazlett/websocket-chat
|
ehazlett/websocket-chat
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: for this to work you must have an entry for `demo.local` in your local hosts (i.e. `/etc/hosts`) file.
|
> **Note**: for this to work, you must have an entry for `demo.local` in your local hosts (i.e. `/etc/hosts`) file.
|
||||||
> This uses the browser for websocket communication so you will need to have an entry or use a routable domain.
|
> This uses the browser for websocket communication, so you must have an entry or use a routable domain.
|
||||||
|
|
||||||
Interlock will detect once the service is available and publish it. Once the tasks are running
|
|
||||||
and the proxy service has been updated the application should be available via `http://demo.local`. Open
|
|
||||||
two instances of your browser and you should see text on both instances as you type.
|
|
||||||
|
|
||||||
|
Interlock detects when the service is available and publishes it. Once tasks are running
|
||||||
|
and the proxy service is updated, the application should be available via `http://demo.local`. Open
|
||||||
|
two instances of your browser and text should be displayed on both instances as you type.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue