Skip to content
Discussion options

You must be logged in to vote

The problem was browser still needs to access it as localhost because it does not know about the docker service name, and the socket is being formed using the browser and not the container.

// Changes in the backend 
CORS(app, origins=["*","http://localhost:5173"])
socketio = SocketIO(app, cors_allowed_origins=["*", "http://localhost:5173"], logger=True, engineio_logger=True)
// Changes in the frontend 
const socket = io('http://localhost:7784', {transports: ['websocket', 'polling', 'flashsocket']});

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nuttysunday
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development
1 participant