How to connect from one app to another, via the internal network?
-
How to do i connect to app A from app B, via the internal cloudron network?
Not sure if the ip address given by
ifconfig
is consistent across instance restarts.Also, tried
host.docker.internal
&localhost
.... didn't work. -
@shrey you can use the app id as the host name. You can also get the raw ip by running
ip addr
in the web terminal of the app.app id is preferred if that works because the ip might change because of platform changes.
Currently, the url
http://<app id>
seems to be reachable only from the terminal (e.g. of another app).If i try to reach this url from inside the other internal app (e.g. access the directus url via n8n, both on the same cloudron), i receive the error:
NodeApiError: The service refused the connection - perhaps it is offline connect ECONNREFUSED fd00:c107:d509::56:8055
PS: The url
http://<app-internal-ip>
works fine -
Curious to hear what your use case for this is
-
Curious to hear what your use case for this is
@andreasdueren
Sure,@shrey said in How to connect from one app to another, via the internal network?:
e.g. access the directus url via n8n
-
Currently, the url
http://<app id>
seems to be reachable only from the terminal (e.g. of another app).If i try to reach this url from inside the other internal app (e.g. access the directus url via n8n, both on the same cloudron), i receive the error:
NodeApiError: The service refused the connection - perhaps it is offline connect ECONNREFUSED fd00:c107:d509::56:8055
PS: The url
http://<app-internal-ip>
works fine@shrey said in How to connect from one app to another, via the internal network?:
PS: The url http://<app-internal-ip> works fine
If you run
host <app id>
, it will resolve to the internal IP. So, I am not sure why it's not working with app id. But it works for me here. For example:# curl -L http://dfa81ea4-9a21-4a58-9283-05c5fef1161b | wc -l % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 16067 100 16067 0 0 42339 0 --:--:-- --:--:-- --:--:-- 382k 75
-
Note that depending on the app, you might have to query a different port i.e the port it is listening on.
# curl -L http://12aded8a-8c78-4b6c-bdbe-2d549b1c2eb5:3000 | wc -c % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 11 0 11 0 0 1412 0 --:--:-- --:--:-- --:--:-- 1571 100 11 0 11 0 0 417 0 --:--:-- --:--:-- --:--:-- 417 100 143k 100 143k 0 0 1464k 0 --:--:-- --:--:-- --:--:-- 1464k 147314
Directus listens on port 8055 and n8n on port 5678
-
G girish has marked this topic as solved on