Skip to content

Commit

Permalink
not support reverse proxy, because this is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Jan 12, 2019
1 parent 95eb727 commit 4aec3c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions adb/tcpusb.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ func (sess *Session) onOpen(pkt Packet) {
name := string(pkt.BodySkipNull())
log.Infof("Calling #%s, remoteId: %d, localId: %d", name, remoteId, localId)

if strings.HasPrefix(name, "reverse:") {
failMessage := "reverse service not supported"
sess.writePacket(_OKAY, localId, remoteId, nil)
sess.writePacket(_WRTE, localId, remoteId, []byte("FAIL"+fmt.Sprintf(
"%04x%s", len(failMessage), failMessage,
)))
sess.writePacket(_CLSE, localId, remoteId, nil)
return
}

// Session service
device := NewClient("").Device(AnyUsbDevice())
conn, err := device.OpenTransport()
Expand Down

0 comments on commit 4aec3c6

Please sign in to comment.