Wrong path to socket.io in production mode when client and server are different #514

Closed
opened 2026-02-04 20:06:01 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @emmguyot-adscom on GitHub (May 21, 2024).

I'm trying to deploy planka with the following directories :

In the client part, I've modified .env to set :

The client is build for production and deployed as static in the planka folder.

First, I had to modify config-overrides.js to replace <%= BASE_URL %> by process.env.PUBLIC_URL in order index.html works as static
But anyway, that's not the point of this issue.

The point is that with this configuration, the planka client keeps to try to access the server at https://xxxx/planka/socket.io/....

I've checked the code and it seems to be in api/socket.js where I see:
socket.path = `${Config.BASE_PATH}/socket.io`;

I think it should be
socket.path = `${Config.SERVER_BASE_PATH}/socket.io`;
where SERVER_BASE_PATH would be a new constant.

Am I wrong?

Originally created by @emmguyot-adscom on GitHub (May 21, 2024). I'm trying to deploy planka with the following directories : * server is accessed at https://xxxx/tasks * client is accessed at https://xxxx/planka In the client part, I've modified .env to set : * REACT_APP_SERVER_BASE_URL=https://xxxx/tasks * PUBLIC_URL=https://xxxx/planka The client is build for production and deployed as static in the planka folder. First, I had to modify config-overrides.js to replace <%= BASE_URL %> by process.env.PUBLIC_URL in order index.html works as static But anyway, that's not the point of this issue. The point is that with this configuration, the planka client keeps to try to access the server at https://xxxx/planka/socket.io/.... I've checked the code and it seems to be in api/socket.js where I see: ```socket.path = `${Config.BASE_PATH}/socket.io`; ``` I think it should be ```socket.path = `${Config.SERVER_BASE_PATH}/socket.io`; ``` where SERVER_BASE_PATH would be a new constant. Am I wrong?
Author
Owner

@meltyshev commented on GitHub (May 22, 2024):

Hi! You're absolutely right, we've never tested this way of deployment. And it seems that your suggestion of adding SERVER_BASE_PATH would solve the problem.

@meltyshev commented on GitHub (May 22, 2024): Hi! You're absolutely right, we've never tested this way of deployment. And it seems that your suggestion of adding `SERVER_BASE_PATH` would solve the problem.
Author
Owner

@emmguyot commented on GitHub (May 22, 2024):

Ok, I'll submit a PR

@emmguyot commented on GitHub (May 22, 2024): Ok, I'll submit a PR
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#514