Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
listen for rotation change
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Nov 15, 2017
1 parent 8cdf762 commit 9597d56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ REM adb install app-debug-androidTest.apk

adb push atx-agent /data/local/tmp
adb shell chmod 777 /data/local/tmp/atx-agent
adb shell /data/local/tmp/atx-agent -d
pause
adb shell /data/local/tmp/atx-agent -d -t 10.240.187.224:8080 -nouia
REM adb shell /data/local/tmp/atx-agent -d -t 10.246.46.160:8200 -nouia
REM pause
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,13 @@ func ServeHTTP(lis net.Listener, tunnel *TunnelProxy) error {
io.WriteString(w, "Success")
}).Methods("POST")

m.HandleFunc("/info/rotation", func(w http.ResponseWriter, r *http.Request) {
var rotation int
json.NewDecoder(r.Body).Decode(&rotation)
log.Println("rotation change received:", rotation)
io.WriteString(w, "Success")
})

m.HandleFunc("/upload/{filepath:.*}", func(w http.ResponseWriter, r *http.Request) {
filepath := mux.Vars(r)["filepath"]
if runtime.GOOS != "windows" {
Expand Down

0 comments on commit 9597d56

Please sign in to comment.