Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrcpy doesn't support forward connection #262

Closed
sosopop opened this issue Feb 21, 2021 · 4 comments
Closed

scrcpy doesn't support forward connection #262

sosopop opened this issue Feb 21, 2021 · 4 comments
Labels
type:enhancement New feature or request

Comments

@sosopop
Copy link

sosopop commented Feb 21, 2021

I use ws backend, scrcpy cant connect same old version adbd by use reverse type
can u mplement scrcpy forward in this project

@yume-chan yume-chan added the type:enhancement New feature or request label Feb 21, 2021
@yume-chan
Copy link
Owner

Just to make sure, you connected to a real device using ADB over WiFi?

@sosopop
Copy link
Author

sosopop commented Feb 22, 2021

是的,Genymobile/scrcpy#5

我参照scrcpy代码中server forward的实现方式简单修改了测试了下,可以正常通讯并显示:
for(let i = 0; i < 100; i++ ) {
try {
await new Promise(resolve => {
window.setTimeout(resolve, 100);
});
let videoSocket = await device.createSocket('localabstract:scrcpy');
videoStream = new AdbBufferedStream(videoSocket);
videoStream.read(1);
let ctrlSocket = await device.createSocket('localabstract:scrcpy');
controlStream = new AdbBufferedStream(ctrlSocket);
break;
} catch (error) {
console.log("stream open failed");
}
}

@yume-chan
Copy link
Owner

对,实现起来不是很难,但是我要做一个设置界面,因为 ws 后端并不是一定对应 ADB over WiFi

@yume-chan
Copy link
Owner

image

在 scrcpy 页面加了个设置面板,修改设置会在下一次连接的时候生效

@yume-chan yume-chan changed the title scrcpy can't connect scrcpy doesn't support forward connection May 2, 2021
Repository owner locked as resolved and limited conversation to collaborators Feb 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants