[Feature Request] expose port for MC app to use #131

Closed
opened 2026-10-05 01:59:01 +02:00 by adam · 37 comments
Owner

Hi
Great work on the app!
Just started using it and have few requests to make =)
Wanted to start with asking if it's possible to expose an additional port in the app, so that Meshcore client app can connect to and be used like normal?
It's great that web app chat is available but its not sending alerts when new message arrives etc.
Plus used a MC app layout =)
The plan was to use my esp32 node as a remote companion, if I do not have my physical companion device with me. But with remote term connected, means that I cannot use the app anymore, only Web app
Should not be too hard (theoretically)to make it talk to the companion if someone connected to the remote term via the app on say port 5001 or something. So it will also become a bridge for devices that are usb/ble/wifi connected through the remote term address

Hi Great work on the app! Just started using it and have few requests to make =) Wanted to start with asking if it's possible to expose an additional port in the app, so that Meshcore client app can connect to and be used like normal? It's great that web app chat is available but its not sending alerts when new message arrives etc. Plus used a MC app layout =) The plan was to use my esp32 node as a remote companion, if I do not have my physical companion device with me. But with remote term connected, means that I cannot use the app anymore, only Web app Should not be too hard (theoretically)to make it talk to the companion if someone connected to the remote term via the app on say port 5001 or something. So it will also become a bridge for devices that are usb/ble/wifi connected through the remote term address <!-- github-sync-id:4250376445 -->
adam closed this issue 2026-10-05 01:59:01 +02:00
Author
Owner

Thank you!

Unfortunately, that's not something that's possible — a MeshCore radio expects one client to be connected to it, speaking the wire protocol for radio control. RemoteTerm is subscribed to radio events, mutating radio state, loading and offloading contacts, etc., all actions that a client is going to assume is NOT happening underneath them (they would expect that the radio is in the last state it was used in). It might be possible to set up a passthrough where we drop all our subscribed radio actions and just pass through traffic, but that totally defeats the purpose of remoteterm, which is that it runs all the time and ingests 100% of mesh traffic. If that was desired, then it would make more sense to use the in-app Disconnect button and just use the radio directly. Proxying a byte-level protocol is far more reliably done by dedicated proxy apps like socat rather than hacking remoteterm to do it.

Thank you! Unfortunately, that's not something that's possible — a MeshCore radio expects one client to be connected to it, speaking the wire protocol for radio control. RemoteTerm is subscribed to radio events, mutating radio state, loading and offloading contacts, etc., all actions that a client is going to assume is NOT happening underneath them (they would expect that the radio is in the last state it was used in). It *might* be possible to set up a passthrough where we drop all our subscribed radio actions and just pass through traffic, but that totally defeats the purpose of remoteterm, which is that it runs all the time and ingests 100% of mesh traffic. If that was desired, then it would make more sense to use the in-app `Disconnect` button and just use the radio directly. Proxying a byte-level protocol is far more reliably done by dedicated proxy apps like socat rather than hacking remoteterm to do it. <!-- github-comment-id:4233153868 -->
Author
Owner

Yeah, I briefly ran my ideas through Claude and it gave some ideas, but not sure if they can be implemented/will work
My idea was that mobile MC app connects to remote term on another port, thinking its a companion, and some daemon translated app requests into the requests that remote term already uses- like get messages, send messages etc

My main gripe is with notifications on mobile, which do not work. Can this be made to run in its own app (for some sites I see installable Chrome apps) or something like remote terminal chat, with reliable notifications?

Yeah, I briefly ran my ideas through Claude and it gave some ideas, but not sure if they can be implemented/will work My idea was that mobile MC app connects to remote term on another port, thinking its a companion, and some daemon translated app requests into the requests that remote term already uses- like get messages, send messages etc My main gripe is with notifications on mobile, which do not work. Can this be made to run in its own app (for some sites I see installable Chrome apps) or something like remote terminal chat, with reliable notifications? <!-- github-comment-id:4233197763 -->
Author
Owner

Progressive Web app

Progressive Web app <!-- github-comment-id:4233205528 -->
Author
Owner

Yeah I've had thoughts about using Web Push (we are already PWA compatible); I have an experimentation branch I should push out and get some beta feedback on. I'll keep you posted.

Yeah I've had thoughts about using Web Push (we are already PWA compatible); I have an experimentation branch I should push out and get some beta feedback on. I'll keep you posted. <!-- github-comment-id:4233222567 -->
Author
Owner

Great!
How do I use PWA? Get no option

Great! How do I use PWA? Get no option <!-- github-comment-id:4233236033 -->
Author
Owner

If you're already serving over a trusted context, it should just be as simple as using the install prompt from your browser menu. However, you need to have a trusted HTTPS context which often needs per-browser customization to add your RemoteTerm host to an always-trusted list (or you can use a non-snakeoil HTTPS cert).

If you're already serving over a trusted context, it should just be as simple as using the install prompt from your browser menu. However, you need to have a *trusted* HTTPS context which often needs per-browser customization to add your RemoteTerm host to an always-trusted list (or you can use a non-snakeoil HTTPS cert). <!-- github-comment-id:4233263560 -->
Author
Owner

Ah sorry looks like I never actually pushed up the serviceworker required for that to work. Doing now.

Ah sorry looks like I never actually pushed up the serviceworker required for that to work. Doing now. <!-- github-comment-id:4233328798 -->
Author
Owner

Okay that's pushed. Now, if you have a trusted context (i.e. valid non-self-signed cert), PWA will work.

Okay that's pushed. Now, if you have a trusted context (i.e. valid non-self-signed cert), PWA will work. <!-- github-comment-id:4233439439 -->
Author
Owner

I'm gonna close this for now, but if you run into any additional issues, feel free to open a new one!

I'm gonna close this for now, but if you run into any additional issues, feel free to open a new one! <!-- github-comment-id:4233452506 -->
Author
Owner

Using docker. Would it automatically update?

Using docker. Would it automatically update? <!-- github-comment-id:4233503476 -->
Author
Owner

How do you mean? You'll need to configure a TLS certificate using a tool like Certbot or a secure tunnel like cloudflared. You can pass the certificate into Docker or use a tunnel that passes traffic to Docker. Unfortunately, setting up trusted HTTPS can be a bit technical if you haven't done it before; you might be able to find some tutorials to help.

I think you can pass a command line flag to Chrome to treat an insecure origin as secure but that will only work for desktop browsers.

How do you mean? You'll need to configure a TLS certificate using a tool like Certbot or a secure tunnel like cloudflared. You can pass the certificate into Docker or use a tunnel that passes traffic to Docker. Unfortunately, setting up trusted HTTPS can be a bit technical if you haven't done it before; you might be able to find some tutorials to help. I think you can pass a command line flag to Chrome to treat an insecure origin as secure but that will only work for desktop browsers. <!-- github-comment-id:4233541899 -->
Author
Owner

You said that you just pushed the code, I assume github. How does it update docker image at docker.io?

You said that you just pushed the code, I assume github. How does it update docker image at docker.io? <!-- github-comment-id:4233559835 -->
Author
Owner

Ohhhhh I follow. Yeah I'll push up a build in 20 minutes or so.

Ohhhhh I follow. Yeah I'll push up a build in 20 minutes or so. <!-- github-comment-id:4233564499 -->
Author
Owner

Thank you =) somewhat new to the dev work

Thank you =) somewhat new to the dev work <!-- github-comment-id:4233569154 -->
Author
Owner

No worries; sorry for misunderstanding your question! New build is pushed. Screenshot_20260412-205600.png

No worries; sorry for misunderstanding your question! New build is pushed. ![Screenshot_20260412-205600.png](https://github.com/user-attachments/assets/56349876-4a51-40ec-9f12-c3d1b6352d6e) <!-- github-comment-id:4233666283 -->
Author
Owner

Much appreciated =)
If I may use your knowledge a bit more - I am using tailscale for remote access and it generates the certs.
When I just generated them and updated docker compose file and restarted it, it just would not want to use the certs until I deleted the container and rebuilt

Much appreciated =) If I may use your knowledge a bit more - I am using tailscale for remote access and it generates the certs. When I just generated them and updated docker compose file and restarted it, it just would not want to use the certs until I deleted the container and rebuilt <!-- github-comment-id:4233716396 -->
Author
Owner

Hmmmm interesting. If it's tailscale handling the certs then I wouldn't expect there to be a need to delete and recreate, unless there's something linked to the container like a tailscale container that's handling the proxying. Even then I wouldn't expect a destroy to be necessary. On the upside, the data directory should be mounted which means that destroying and recreating doesn't really make a material difference to anything/all the data should still be retained.

Hmmmm interesting. If it's tailscale handling the certs then I wouldn't expect there to be a need to delete and recreate, unless there's something linked to the container like a tailscale container that's handling the proxying. Even then I wouldn't expect a destroy to be necessary. On the upside, the data directory should be mounted which means that destroying and recreating doesn't really make a material difference to anything/all the data should still be retained. <!-- github-comment-id:4233747988 -->
Author
Owner

Yeah, tailscale is just handing cert file updates. But when app was reloaded it did not use them
Anyway, thank you for your help

Yeah, tailscale is just handing cert file updates. But when app was reloaded it did not use them Anyway, thank you for your help <!-- github-comment-id:4233805002 -->
Author
Owner

Huh, weird. Not sure what would stop it from picking up new files unless they've moved or something.

Huh, weird. Not sure what would stop it from picking up new files unless they've moved or something. <!-- github-comment-id:4233855212 -->
Author
Owner

Ok. Reloaded config. Install still does not work. When inspecting the code, I get 401 error for the webmanifest file

Ok. Reloaded config. Install still does not work. When inspecting the code, I get 401 error for the webmanifest file <!-- github-comment-id:4234009754 -->
Author
Owner

hm have you set up basic auth? That would be the only way I'd expect the app to return a 401. Maybe wrong username/password or your browser needs to reauth? Are any other resources 401ing or just the webmanifest

hm have you set up basic auth? That would be the only way I'd expect the app to return a 401. Maybe wrong username/password or your browser needs to reauth? Are any other resources 401ing or just the webmanifest <!-- github-comment-id:4234030609 -->
Author
Owner

Yes, basic authentication, as recommended
Other components load up fine apart from manifest
Ai suggest updating index file and some backend code that handles it

Yes, basic authentication, as recommended Other components load up fine apart from manifest Ai suggest updating index file and some backend code that handles it <!-- github-comment-id:4234040547 -->
Author
Owner

Aha, I found the bug. Will push up a fix.

Aha, I found the bug. Will push up a fix. <!-- github-comment-id:4234083967 -->
Author
Owner

Okay new docker image with that bugfix is uploaded. With that, I am on vacation! I will be back at work on remoteterm on thursday or so.

Okay new docker image with that bugfix is uploaded. With that, I am on vacation! I will be back at work on remoteterm on thursday or so. <!-- github-comment-id:4234125524 -->
Author
Owner

I am surprised that you are so actively responding!
Thank you and enjoy!

I am surprised that you are so actively responding! Thank you and enjoy! <!-- github-comment-id:4234129593 -->
Author
Owner

(and sorry, to be clear, that was meant as "and now my vacation begins (yay)" not "I'm on vacation; stop bothering me") Always happy to answer questions as best I can, esp if they're bugs I wrote 😉

(and sorry, to be clear, that was meant as "and now my vacation begins (yay)" not "I'm on vacation; stop bothering me") Always happy to answer questions as best I can, esp if they're bugs I wrote 😉 <!-- github-comment-id:4234153029 -->
Author
Owner

Thank you. 401 is fixed but still does not want to install.
Will wait until you are back at it later in the week

Thank you. 401 is fixed but still does not want to install. Will wait until you are back at it later in the week <!-- github-comment-id:4234256436 -->
Author
Owner

For sure! If you're using Chrome, right click -> inspect element -> Application (tabs at the top) -> Service Worker (left hand bar) should show you the status of service worker installation, which has been the limiting factor for installation as a pwa until now. That might have some interesting debug leads if you're feeling adventurous. Problems with installation might also be visible on the error console. But yeah, if you haven't figured it out, we could dive deeply into it once I'm back.

For sure! If you're using Chrome, right click -> inspect element -> Application (tabs at the top) -> Service Worker (left hand bar) should show you the status of service worker installation, which has been the limiting factor for installation as a pwa until now. That might have some interesting debug leads if you're feeling adventurous. Problems with installation might also be visible on the error console. But yeah, if you haven't figured it out, we could dive deeply into it once I'm back. <!-- github-comment-id:4234293887 -->
Author
Owner

I also tried accessing the manifest file without authentication, which is what browser expects I think. And it's unauthorised
When logged on, it loads fine, but it could be a browser requirements

I also tried accessing the manifest file without authentication, which is what browser expects I think. And it's unauthorised When logged on, it loads fine, but it could be a browser requirements <!-- github-comment-id:4234301567 -->
Author
Owner

The bug fix that I pushed up an image for should include the tag that tells the browser that it will need to pass the credentials on in order to access that file; if you are still seeing a 401 in your network requests, clearly something's going screwy there.

The bug fix that I pushed up an image for should include the tag that tells the browser that it will need to pass the credentials on in order to access that file; if you are still seeing a 401 in your network requests, clearly something's going screwy there. <!-- github-comment-id:4234319125 -->
Author
Owner

Ai says manifest must be accessible without auth. I will try removing basic authentication and test

Ai says manifest must be accessible without auth. I will try removing basic authentication and test <!-- github-comment-id:4234334194 -->
Author
Owner
Image
<img width="1198" height="367" alt="Image" src="https://github.com/user-attachments/assets/00c07051-526b-493c-bfcd-6ec3cb3995e8" /> <!-- github-comment-id:4234347947 -->
Author
Owner

Now AI says that even though we have

"icons": [
{
"src": "https://smartserver.tail7e6204.ts.net:8000/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "https://smartserver.tail7e6204.ts.net:8000/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}

at least of these is meant to have purpose of "any"

Now AI says that even though we have "icons": [ { "src": "https://smartserver.tail7e6204.ts.net:8000/web-app-manifest-192x192.png", "sizes": "192x192", "type": "image/png", **"purpose": "maskable"** }, { "src": "https://smartserver.tail7e6204.ts.net:8000/web-app-manifest-512x512.png", "sizes": "512x512", "type": "image/png", **"purpose": "maskable"** } at least of these is meant to have purpose of "any" <!-- github-comment-id:4234374266 -->
Author
Owner

Added and pushed 🙂

Added and pushed 🙂 <!-- github-comment-id:4234428682 -->
Author
Owner

It did not like svg icons. But even when manually removed, it's still not giving me option to install. Giving up for now

It did not like svg icons. But even when manually removed, it's still not giving me option to install. Giving up for now <!-- github-comment-id:4234624864 -->
Author
Owner

After a while (and don't know if a coincident) it prompted to install! (I removed svg icon)

After a while (and don't know if a coincident) it prompted to install! (I removed svg icon) <!-- github-comment-id:4235678181 -->
Author
Owner

Awesome; I've moved those over to pngs. And yeah, I think the prompt is based on a wall clock of usage time but it should always be addable from the browser menu. I'm gonna close this for now; if you run into any other PWA issues feel free to open a new issue.

Awesome; I've moved those over to pngs. And yeah, I think the prompt is based on a wall clock of usage time but it should always be addable from the browser menu. I'm gonna close this for now; if you run into any other PWA issues feel free to open a new issue. <!-- github-comment-id:4262592134 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Remote-Terminal-for-MeshCore#131