-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port forwarding over SSH (probably just a few modifications to common.js) #2681
Comments
I think this is out of scope for this project as it is very special. |
No no. What I mean is the following.
Say you have a network remotely with some machine, a tiny server like a
Pi4, that you can access somehow over VPN or Tailscale.
Then you can vpn to that machine and Ssh to it. You can also port forward
any service in the network you want to access, say you have a webcam or
something.
Now if you do that eg. with some Tasmota ESP camera or a crappy aliexpress
webcam, you can just access the device webpage, if you forwarded port 80 to
e.g. 127.0.0.1:4000. This also works with AIonTheEdge, but only partially.
The common.js does not serve all the data on port 80 but switches to some
hard-coded development IP instead to access resources and fails internally
(I guess) if the dev IP is not the actual IP of the device. So this is
certainly a shortcoming of this file…
CaCO3 ***@***.***> schrieb am Fr. 3. Nov. 2023 um 22:12:
… I think this is out of scope for this project as it is very special.
The device only has an interface for HTTP (Port 80) ans MQTT (Port 1883).
If i understand you right, you only have a tunnel to port 22 (SSH). So the
device would need to serve HTTP on port 22 for you. This is very special.
Not sure what kind of router7gateway you have, eg. with a fritzbox, you
could route the external port 22 to the port 80 of the device. Your
webbrowser then would need to access the device using port 22.
—
Reply to this email directly, view it on GitHub
<#2681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3R4AHJIHJVWFDFOEKOM3YCVM47AVCNFSM6AAAAAA644RDWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGEYTCMJTGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Btw, Your example will also not work. Internally any redirection will not
work…
CaCO3 ***@***.***> schrieb am Fr. 3. Nov. 2023 um 22:12:
… I think this is out of scope for this project as it is very special.
The device only has an interface for HTTP (Port 80) ans MQTT (Port 1883).
If i understand you right, you only have a tunnel to port 22 (SSH). So the
device would need to serve HTTP on port 22 for you. This is very special.
Not sure what kind of router7gateway you have, eg. with a fritzbox, you
could route the external port 22 to the port 80 of the device. Your
webbrowser then would need to access the device using port 22.
—
Reply to this email directly, view it on GitHub
<#2681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3R4AHJIHJVWFDFOEKOM3YCVM47AVCNFSM6AAAAAA644RDWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGEYTCMJTGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I think you might run into our test functions for the UI, see https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/sd-card/html/common.js#L2..L17 Is your host name maybe empty/not properly transmitted? |
It is properly set, but it is part of the problem. The hostname is not
accessible when you only have the tunnel to port 80…
CaCO3 ***@***.***> schrieb am Sa. 4. Nov. 2023 um 18:14:
… I think you might run into our test functions for the UI, see
https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/sd-card/html/common.js#L2..L17
Is your host name maybe empty/not properly transmitted?
—
Reply to this email directly, view it on GitHub
<#2681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3R4DJCHGZDNAREMG3SZLYCZZXNAVCNFSM6AAAAAA644RDWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGQ4TSMRXHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Can you test if it is fixed when you simply remove this part? || (host == "") |
indeed... it is actually this part (host == "127.0.0.1") as a standard redirect goes to the loopback device. Just using the port forwarding to the local ethernet interface works... |
Hmm, not sure why this goes wrong for you. |
Well, if you redirect it to something like
you necessarily have to access it under
and then the test code kicks in. It is working for me now, but the 127.0.0.1 should probably be removed if it is not ultimately necessary and for testing only. It would make the port forwarding work for everybody then - I did not think about running into such a problem at all when I started... |
Reworked inhttps://github.com/jomjol/AI-on-the-edge-device/commit/36c12b400bfab15321e409c4421074e4223432a1 |
Avoid issues with forwarding to loopback 127.0.0.1 (jomjol#2681)
The Feature
First kudos - it is amazing what you have created. I have two digit readers in action, and it works great!
I just discovered one issue that might or might not be corrected easily. One of the meters is on a remote site, which I can just access over ssh with some port forwarding to the ESP32. The access basically works, but since there is some hard-coded redirection to an IP, most of the page is not served. It can easily be reproduced.
There is a workaround on a Mac/Linux at least, where there is the virtual interface (say bridge1) which is given the same IP as the ESP and then port-map the ip/port from remote to local:
In between accessing the IP (10.97.1.233 in this case) everything works.
The text was updated successfully, but these errors were encountered: