stanford-oval / genie-server

The home server version of Almond
Apache License 2.0
266 stars 42 forks source link

Docker port mapping websocket errors #308

Closed Guigxs closed 2 years ago

Guigxs commented 2 years ago

Hi, I'm trying to install genie-server on my desktop with docker. But I'm facing some websocket errors while mapping the host port 3001 to the container port 3000.

Any idea how to fix ?

That's my docker command: docker run --name genie-server -p 3001:3000 stanfordoval/almond-server:latest

genie-server on port 3001: image

genie-server on port 3000: image

gcampax commented 2 years ago

To prevent cross-origin connections (which would be insecure), the server checks that the Origin header sent by the browser corresponds to the combination of host and port used by the browser. Hence, what you're trying to do is not possible directly. If you want to run genie-server on a different port, you must set the PORT environment variable in the container to 3001 and map port 3001 to 3001 in the container.

Guigxs commented 2 years ago

That makes sens, thanks !