From a05f011b3ed7737f2250182ec922e446606c059d Mon Sep 17 00:00:00 2001 From: "Justin D. Harris" Date: Fri, 25 Dec 2020 22:36:50 -0500 Subject: [PATCH] server: Add network docs to help address #45 --- server/README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/server/README.md b/server/README.md index f3984ec..b6fb8de 100644 --- a/server/README.md +++ b/server/README.md @@ -30,6 +30,25 @@ sudo python3 switchremoteplay/server.py --help You can change the controller type, the port used by the socket service, and the log level. +# Networking Setup +The client webpage in your browser will need to know the address of the server. + +## Same Network +You will need the local IP address or hostname of your device running the server. +Your public IP address will likely not work. +On linux, you can run `hostname` and you should get what you need. +For example, on a Rapsberry Pi, it my just be "raspberrypi". +Once the server has started, you can enter http://raspberrypi:5000 (5000 for the default port) as the "Server Address" on the client page. +If you just have the local network IP address (usually starts with `192.168`), then enter that as the server address, for example: `http://192.168.2.17:5000`. + +## Over the Internet +Do this if you are connecting to a server on another network, for example, your friend's Switch and server device at their house. +The person with the Switch and running the server will need to find their public IP address. +One way to do this is for this person to open https://ifconfig.me and check what is says for "IP Address". +They will also have to make sure to set up "port forwarding" in their router settings so that requests from outside of their local network get mapped to the server. + +You might be able to avoid port forwarding if you use [ngrok](https://ngrok.com/) but it might not be as secure and will likely reduce speed. + # API This sections discusses the format of commands that the server expects. This section is useful for developers and people writing macros. @@ -123,7 +142,7 @@ Example: Push the right stick halfway to the right and halfway up: `'s r hv 0.5 Example: Push the left stick halfway to the right and halfway down: `'s l hv 0.5 0.5'`. -# Wait +## Wait This is mainly for macros. This server itself will not recognize `wait` commands. There is an ongoing discussion [here](https://github.com/juharris/switch-remoteplay/issues/8).