Use websockets

This topic describes how to use websockets with Interlock.

  1. Create an overlay network to isolate and secure service traffic:

    docker network create -d overlay demo

    Example output:

  2. Create the service with websocket endpoints:

    docker service create \
    --name demo \
    --network demo \
    --detach=false \
    --label \
    --label \
    --label \

    Interlock detects when the service is available and publishes it.


    You must have an entry for demo.local in your /etc/hosts file or use a routable domain.

  3. Once tasks are running and the proxy service is updated, the application will be available at http://demo.local. Navigate to this URL in two different browser windows and notice that the text you enter in one window displays automatically in the other.