From 6f6facae0f490844c002c84575c17c27ad4bf48b Mon Sep 17 00:00:00 2001 From: jebba Date: Tue, 25 Jan 2022 16:29:06 -0700 Subject: [PATCH] Forward port 8080 via USB --- README.md | 1 + scripts/pysalx-api-port | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 scripts/pysalx-api-port diff --git a/README.md b/README.md index 9e7a431..c500be4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Current scripts: * `pysalx-api-config` --- Get analyzer configuration via API. * `pysalx-api-id` --- Get analyzer ID via API. +* `pysalx-api-port` --- Forward web port 8080 via USB to localhost. * `pysalx-api-status` --- Get analyzer status via API. * `pysalx-api-test` --- Do Analyzer test via API. * `pysalx-api-wlcalibration` --- Get analyzer wavelength calibration via API. diff --git a/scripts/pysalx-api-port b/scripts/pysalx-api-port new file mode 100755 index 0000000..f32509c --- /dev/null +++ b/scripts/pysalx-api-port @@ -0,0 +1,17 @@ +#!/bin/bash +# The API listens on port 8080 on the device. +# That can be connected to while using the device's +# shell (e.g. `adb shell`), or remotely via the +# DHCP assigned IP or the static IP 192.168.42.129. +# +# This script will allow you to access the device's API, +# when plugged in via USB, on port 8080 of the local +# workstation. +# So, for example after running this, you can hit this +# from the workstation: +# http://127.0.0.1:8080/api/v2/status + +set -x + +adb forward tcp:8080 tcp:8080 +