luke-cha / ios-screen-mirror

ios-screen-mirror
MIT License
57 stars 9 forks source link

Integration with NodeJS #2

Open Echenique opened 3 years ago

Echenique commented 3 years ago

Hello, I'm trying to integrate with a Node server.

I can receive the connection, but I cannot receive the screen. which socket event should I listen to to receive the screen?

Example:

running ios-screen-mirror: ./ios-screen-mirror -udid "IOS_SERIAL" -pull -pushSpec "tcp://127.0.0.1:5443"

and, on my server node i was running server listen 5443 port

var protocol = require("eight-protocol");
var server =  new protocol.server(5443);

server.on('server_listening', function(){
    console.log("Server ir up! Now waiting for connections"); 
});
server.on('client_connected', function(socket){
    console.log("NEW CLIENT CONNECTED!"); //HERE I GET CONNECTION SUCCESS
});
server.on("message", function(socketClient, header, dataBuffer){
    console.log("MESSAGE RECEIVED!",header,dataBuffer.toString()); //BUT DONT RECIEVE DATA HERE
});
server.on('client_close', function(socketClient){
    console.log("CLIENT DISCONNECTED!");
});
donmezburak commented 3 years ago

any updates ?