Can not add reverse socket connection
See original GitHub issueIssue Checklist
- I’m using the library programmatically
Library version
0.0.14
Runtime
Linux, Chrome Version 100.0.4896.127 (Official Build) (64-bit)
Device
DJI FPV goggles V2
Describe the bug
I am trying to add a reverse socket connection, basically what adb reverse tcp:0 tcp:6666
does:
const credentialStore = new AdbWebCredentialStore();
const device = await AdbWebUsbBackend.requestDevice();
const streams = await device.connect();
const adb = await Adb.authenticate(streams, credentialStore, undefined);
await adb.reverse.add("tcp:0", "tcp:6666", {
onSocket: (packet, socket) => {
//...
}
});
Is resulting in this error:
Error: Stream ended
at AdbBufferedStream.read (buffered.ts:49:1)
I could trace it till here, seems something fails during de-serialization: https://github.com/yume-chan/ya-webadb/blob/d0a8257a2dd7e315bc191565695c22330e588f7a/libraries/adb/src/commands/reverse.ts#L95
Steps to reproduce
const credentialStore = new AdbWebCredentialStore();
const device = await AdbWebUsbBackend.requestDevice();
const streams = await device.connect();
const adb = await Adb.authenticate(streams, credentialStore, undefined);
await adb.reverse.add("tcp:0", "tcp:6666", {
onSocket: (packet, socket) => {
//...
}
});
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
socket.io example sometimes not connecting client side when ...
Using node-http-proxy, I've set up a reverse proxy for routing requests:
Read more >Reverse Proxy Support #1754 - socketio/socket.io - GitHub
I've configured nginx to act as a reverse proxy to socket.io server under a specific url (/socket/). It works. I load the Socket....
Read more >Troubleshooting connection issues | Socket.IO
You are trying to reach a plain WebSocket server; The server is not reachable; The client is not compatible with the version of...
Read more >What can I do if I see "Cannot connect to WebSocket" when ...
Go to Control Panel > Application Portal > Reverse Proxy. · Select the rule with the issue and click Edit. · Go to...
Read more >Python Reverse Shell Tutorial - 2 - Binding the Socket and ...
10 Programming Languages in ONLY 15 minutes! · 18 Commands That Will Change The Way You Use Linux Forever.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Version 0.0.15 released with the compatibility fix for Android 7 (and older) and some API changes.
Here is an example, I only tested it on Android 9 because this device has netcat.
https://github.com/yume-chan/ya-webadb/blob/12f88c355c63a8fbfc677adef1c2a5c6675195cb/apps/demo/src/pages/reverse.tsx#L17-L31
The handler now needs to return
true
to accept the connection, otherwise the dispatcher will ask the next handler (if any) and ultimately reject it. No packet will arrive before return, and.pipeTo(new WritableStream())
is the most common method to handle a stream in Web Streams API.The second parameter is now a string and it can be any value without null characters.
Glad to hear that!