Contour Logo

Documentation

Introduction

Configuration

Deployment

Guides

Troubleshooting

Resources

Security

Contribute

Websockets

WebSocket support can be enabled on specific routes using the enableWebsockets field:

# httpproxy-websockets.yaml
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: chat
  namespace: default
spec:
  virtualhost:
    fqdn: chat.example.com
  routes:
  - services:
    - name: chat-app
      port: 80
  - conditions:
    - prefix: /websocket
    enableWebsockets: true # Setting this to true enables websocket for all paths that match /websocket
    services:
    - name: chat-app
      port: 80

If you are using Gateway API, websockets are enabled by default at the Listener level.

Ready to try Contour?

Read our getting started documentation.