balderdashy / balderdashy/sails
Cannot connect to sockets on production
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
**Sails version**: "sails": "^1.0.2",
**Node version**: v10.1.0
**NPM version**: 5.6.0
**DB adapter name**: "sails-postgresql":
**DB adapter version**: "^1.0.1"
**Operating system**: mac OS HighSierra 10.13.4 (17E202)
Hi,
Connecting to sockets on dev works fine.
When going to prod I'm declaring the config in an env variable but sails doesn't allow the connection.
I've enabled a log level to read (Note the trailing slash of the url):

The env variable is read from Sails since when I delete it Sails doesn't allow to run the app as it throws an error saying that sockets allow origins is not set up.

The problem is that somehow the env variable doesn't match with the string in the query. Could it be maybe the trailing slash that it outputs in the first image?


Contributor guide
Research direction
Start by reproducing the production socket connection with the configured environment variable and compare the logged allowed-origin value with the connection URL shown in the screenshots. Done means the production app accepts the intended socket connection using the environment configuration, including a clear result for the trailing-slash difference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100