2

I'm having some problems to establish a websocket connection to a running ddev container. Trying wo etablish the connection per JS for example with wss://websocket.ddev.site:3000 ends always up with connection failed.

Websocket PHP library used: Ratchet (http://socketo.me/)

I tried to set the ext. container port in an own docker-compose.yaml or web_extra_exposed_ports in config.yaml but nothig worked so far.

Marlinek
  • 61
  • 4

1 Answers1

4

I have managed to run a Websocket connection.

Therefore, I did an entry in config.yaml of DDEV with following Content:

web_extra_exposed_ports:
  - name: ratchet
    container_port: 3000
    http_port: 3000
    https_port: 3001

After DDEV restart, it is now possible to establish a Websocket connections with:

HTTP: 'ws://websocket.ddev.site:3000'
HTTPS: 'wss://websocket.ddev.site:3001'

My working example was build with the tutorial on http://socketo.me/docs/hello-world calling above URL with Browser console.

Marlinek
  • 61
  • 4