Umm, I will try to be more clear.
On the application server that I wrote in node.js, I have an internal proxy for several ports:
- In my port
8080 I have rest api . - In my
3000 port, I have my push server and chat .
I use the npm subdomain-router package for internal routing to a port, exposing the subdomains in the "front-end", which proxy back to these ports.
code demonstration: ( <some-app> clearly not the true name of the application)
require('subdomain-router') ({ host: '<some-app>.herokuapp.com', subdomains: { '': 8080, // <some-app>.herokuapp.com <=> ::8080 --WORKS-- 'api': 8080, // api.<some-app>.herokuapp.com <=> ::8080 'chat': 3000, // chat.<some-app>.herokuapp.com <=> ::3000 'push': 3000 // push.<some-app>.herokuapp.com <=> ::3000 } }).listen(process.env.PORT || 5000);
The API works fine, although I cannot access it through <some-app>.herokuapp.com:8080 , but only through <some-app>.herokuapp.com and let the subdomain-router internal module make it magical.
In addition, I cannot access the sub-regions. When I try to access the api.<some-app>.herokuapp.com I get a No such app error page from heroku.
TL; DR access to <some-app>.herokuapp.com works (redirects to the /v1 path for my API), but cannot access <some-app>.herokuapp.com:8080 , <some-app>.herokuapp.com:3000 or chat.<some-app>.herokuapp.com .
When I try to access my API by specifying the port in the URL (for example: <some-app>.herokuapp.com:8080 ), I get the following error in my browser (google chrome): ERR_CONNECTION_REFUSED .
My educated guess suggests that this may be due to the opening of ports in the hero, but I do not know how to do this (I tried googling ofc). <sh> This does not explain why I cannot access the subdomains.
Would thank any light shed on this issue.
I'm new to the hero and it really upsets.
Thanks!
Amit
Amit evron
source share