Guillaume LUNIK
Guillaume LUNIK

Reputation: 169

Socket.io, connect to socket inside docker container

My app is using websocket with Socket.io library. On the fronted, I open a connection to a backend socket like this :

io.connect(window.location.origin)

Everything is working fine when my backend is running on my computer. But when I run it inside a docker container, I get this error on my client:

WebSocket connection to 'ws://localhost/socket.io/?EIO=3&transport=websocket' failed: Invalid frame header

Upvotes: 0

Views: 868

Answers (1)

Guillaume LUNIK
Guillaume LUNIK

Reputation: 169

Figured out that I must make the socket listen on '0.0.0.0'

Upvotes: 1

Related Questions