I'm not sure if this is possible, but my plan is to make a localhost website for a personal project that runs on a raspberry pi and my pc. The website would be comprised of multiple images and a spotify embed, my raspberry pi would host a screen showing a selected image, whereas my pc would act as a controller, selecting items to display and queuing audio from Spotify, is this possible?
-
maybe this can help: https://dilshankelsen.com/how-to-access-localhost-on-another-device/ I am not an expert in this things but I research it and see it on google.com – Laaouatni Anas Jan 10 '22 at 18:14
1 Answers
localhost is 127.0.0.1. You can give this IP a Port number like 8080. When you run a server that services IP 127.0.0.1:8080, you can point any devices on your Network to 127.0.0.1:8080 and gain access to a web app you host there.
in many frameworks like Flask and Django, you can create routes like this
- 127.0.0.1:8080/mobile/images
- 127.0.0.1:8080/pc/radio
each route can be configured to host the right "domain" for your solution.
Don't forget you can also use internal IP address on your network too!
here is a great article about internal and external Ip's:
with internal ip's you can create your own Intranet! I bought a NAS server and have my own internet set up using internal Ip addresses!
also look into how to create https vs http sites. HTTPS is secured and encrypted with SSl and TLS.
here is a good post that covers https: