开发者

Is there a way to access the remote IP of a RTMFP p2p stream?

开发者 https://www.devze.com 2023-01-19 01:43 出处:网络
I\'m writing a communication system, using Actionscript 3 and C#. Flash is used to communicate with RTMP server and stream video and audio using RTMFP p2p, but the actual client logic is handled in C#

I'm writing a communication system, using Actionscript 3 and C#. Flash is used to communicate with RTMP server and stream video and audio using RTMFP p2p, but the actual client logic is handled in C#.

What I want to be able to do, is allow users to share files between each other also using a direct p2p connection.

I have got the RTMFP connection working but I need to access the IP address of the remote user so I can initiate a connection to send or receive files.

I looked at the Adobe docs but I can't see anything except how 开发者_C百科to access the farID.

Is there a way to get the IP of a RTMFP stream?


I think you can't get the IP address through RTMFP connection, but you could use a shared object to record client IPs as a workaround:

application.onAppStart = function() {
    application.so = SharedObject.get('my_shared_obj');
}    

application.onConnect = function(clientObj, username, password) {
    // TODO check username and password

    application.so.setProperty(clientObj.farID, clientObj.ip);
}

application.onDisconnect = function(clientObj) {
    application.so.setProperty(clientObj.farID, null);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消