Can't use localtunnel properly with app proxy
-
Hi there,
I'm trying to install localtunnel server in order to share my local stuffs to the world.
I have localtunnel server working properly on port 4000 on my server, using docker (I just changed the port to 4000).I use an app proxy to be able to contact this service from outside :
With ssh in my server I got this :
$ curl http://localhost:4000/api/status {"tunnels":0,"mem":{"rss":59826176,"heapTotal":33873920,"heapUsed":20766296,"external":699069}}
But when I try to call it from outside of the server, I got this :
$ curl https://app.[mynameserver]/api/status 404
Can you help me on this please ?
-
If this can help, here is the app proxy log :
app.[mynameserver] (App Proxy) Jan 31 16:36:02box:taskworker Starting task 781. Logs are at /home/yellowtent/platformdata/logs/7680a923-b928-4f51-9ddb-18d9c1da18e8/apptask.log Jan 31 16:36:02box:apptask run: startTask installationState: pending_install runState: running Jan 31 16:36:02box:tasks update 781: {"percent":10,"message":"Cleaning up old install"} Jan 31 16:36:02box:shell reload spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/restartservice.sh nginx Jan 31 16:36:02box:apptask deleteContainer: deleting app containers (app, scheduler) Jan 31 16:36:02box:shell removeLogrotateConfig spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/configurelogrotate.sh remove 7680a923-b928-4f51-9ddb-18d9c1da18e8 Jan 31 16:36:02box:services teardownAddons: Tearing down ["proxyAuth"] Jan 31 16:36:02box:services teardownAddons: Tearing down addon proxyAuth with options {} Jan 31 16:36:02box:tasks update 781: {"percent":20,"message":"Downloading icon"} Jan 31 16:36:02box:apptask downloadIcon: Downloading icon of io.cloudron.builtin.appproxy@1.0.2 Jan 31 16:36:03box:tasks update 781: {"percent":30,"message":"Registering subdomains"} Jan 31 16:36:03box:dns registerLocations: Will register [{"subdomain":"app","domain":"[mynameserver]"}] with options {"overwriteDns":false} Jan 31 16:36:03box:network/generic getIPv4: querying ipv4.api.cloudron.io to get server IPv4 Jan 31 16:36:03box:tasks update 781: {"message":"Registering location app.[mynameserver]"} Jan 31 16:36:03box:dns upsertDNSRecord: location app on domain [mynameserver] of type A with values ["[myIPserver]"] Jan 31 16:36:03box:dns/manual upsert: app for zone [mynameserver] of type A with values ["[myIPserver]"] Jan 31 16:36:03box:tasks update 781: {"percent":40,"message":"Downloading image"} Jan 31 16:36:03box:tasks update 781: {"percent":50,"message":"Creating app data directory"} Jan 31 16:36:03box:tasks update 781: {"percent":60,"message":"Setting up addons"} Jan 31 16:36:03box:services Setting up proxyAuth Jan 31 16:36:03box:services setupAddons: Setting up ["proxyAuth"] Jan 31 16:36:03box:services setupAddons: setting up addon proxyAuth with options {} Jan 31 16:36:03box:tasks update 781: {"percent":80,"message":"Creating container"} Jan 31 16:36:03box:apptask startApp: starting container Jan 31 16:36:03box:tasks update 781: {"percent":85,"message":"Waiting for DNS propagation"} Jan 31 16:36:03box:tasks update 781: {"message":"Waiting for propagation of app.[mynameserver]"} Jan 31 16:36:03box:dns/waitfordns waitForDns: waiting for app.[mynameserver] to be [myIPserver] in zone [mynameserver] Jan 31 16:36:03box:dns/waitfordns waitForDns: nameservers are ["ns1.dns-parking.com","ns2.dns-parking.com"] Jan 31 16:36:03box:dns/waitfordns resolveIp: Checking if app.[mynameserver] has A record at 162.159.24.201 Jan 31 16:36:03box:dns/waitfordns isChangeSynced: app.[mynameserver] (A) was resolved to [myIPserver] at NS ns1.dns-parking.com (162.159.24.201). Expecting [myIPserver]. Match true Jan 31 16:36:03box:dns/waitfordns resolveIp: Checking if app.[mynameserver] has A record at 162.159.25.42 Jan 31 16:36:03box:dns/waitfordns waitForDns: app.[mynameserver] at ns ns1.dns-parking.com: done Jan 31 16:36:03box:dns/waitfordns isChangeSynced: app.[mynameserver] (A) was resolved to [myIPserver] at NS ns2.dns-parking.com (162.159.25.42). Expecting [myIPserver]. Match true Jan 31 16:36:03box:dns/waitfordns waitForDns: app.[mynameserver] at ns ns2.dns-parking.com: done Jan 31 16:36:03box:dns/waitfordns waitForDns: app.[mynameserver] has propagated Jan 31 16:36:03box:tasks update 781: {"percent":95,"message":"Configuring reverse proxy"} Jan 31 16:36:03box:reverseproxy providerMatchesSync: subject=CN = app.[mynameserver] domain=app.[mynameserver] issuer=C = US, O = Let's Encrypt, CN = R3 wildcard=false/false prod=true/true issuerMismatch=false wildcardMismatch=false match=true Jan 31 16:36:03box:reverseproxy ensureCertificate: app.[mynameserver] acme cert exists and is up to date Jan 31 16:36:03box:reverseproxy expiryDate: subject=CN = app.[mynameserver] notBefore=Jan 31 13:32:16 2024 GMT notAfter=Apr 30 13:32:15 2024 GMT daysLeft=89.91401716435185 Jan 31 16:36:03box:reverseproxy needsRenewal: false. force: false Jan 31 16:36:03box:reverseproxy writeAppLocationNginxConfig: writing config for "app.[mynameserver]" to /home/yellowtent/platformdata/nginx/applications/7680a923-b928-4f51-9ddb-18d9c1da18e8/app.[mynameserver].conf with options {"sourceDir":"/home/yellowtent/box","vhost":"app.[mynameserver]","hasIPv6":true,"ip":null,"port":3000,"endpoint":"external","redirectTo":null,"certFilePath":"/home/yellowtent/platformdata/nginx/cert/app.[mynameserver].cert","keyFilePath":"/home/yellowtent/platformdata/nginx/cert/app.[mynameserver].key","robotsTxtQuoted":null,"cspQuoted":null,"hideHeaders":[],"proxyAuth":{"enabled":false,"id":"7680a923-b928-4f51-9ddb-18d9c1da18e8","location":"/"},"upstreamUri":"http://localhost:4000","ocsp":true,"hstsPreload":false} Jan 31 16:36:03box:shell reload spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/restartservice.sh nginx Jan 31 16:36:04box:tasks update 781: {"percent":100,"message":"Done"} Jan 31 16:36:04box:taskworker Task took 1.43 seconds Jan 31 16:36:04box:tasks setCompleted - 781: {"result":null,"error":null} Jan 31 16:36:04box:tasks update 781: {"percent":100,"result":null,"error":null} Jan 31 16:36:10=> Healtheck error: Error: connect ECONNREFUSED ::1:4000 Jan 31 16:36:20=> Healtheck error: Error: connect ECONNREFUSED ::1:4000 Jan 31 16:36:30=> Healtheck error: Error: connect ECONNREFUSED ::1:4000 Jan 31 16:36:40=> Healtheck error: Error: connect ECONNREFUSED ::1:4000 Jan 31 16:36:50=> Healtheck error: Error: connect ECONNREFUSED ::1:4000 Jan 31 16:37:00=> Healtheck error: Error: connect ECONNREFUSED ::1:4000
-
I don't know what that localtunnel software does, however running it on the same server installed on the side of Cloudron will most likely break something in the long run, so I can't recommend that.
For the actual error, is localtunnel listening on the ipv6 interface where the health check tries to call?
-
@doon per the docs, you have to pass --domain also . See https://github.com/localtunnel/server?tab=readme-ov-file#setup
So, pass
--domain app.domain.com
to the docker arguments .To mimic how the reverse proxy calls try:
curl -H 'Host: app.domain.com' http://localhost:4000/api/status
The above must work first for the reverse proxy to work.
And two other things: that app hasn't been updated for 5 years it seems.... And don't run additional stuff on cloudron server itself. We don't support this.
-
-