P2p direct AIR 2 AIR, if both users know IP addresses

If I know another users IP address, can I directly send them a message if we both have the same AIR app open?

I’ve used MonaServer before. Is it possible to do p2p without it?

I works on LAN network, did not find any way to do that over the internet.
Mona server works great though. You can use there Raspberry PI server for tests. From what I know WebRTC has similar handshake mechanisms that require 3 party to facilitate meeting of peers. RTMFP is very good for low latency dependency apps.

hey

depends of your context, is it over a LAN, is it over the internet?

over the internet you have to use a “rendez vous server”, could be monaserver, cumulus, arcusnode, etc.

over a LAN you don’t need a server

eg.

var nc:NetConnection = new NetConnection;
    nc.connect( "rtmfp:" );

see NetConnection.connect()

  • Pass the string “rtmfp:” to create a serverless two-way network endpoint for RTMFP IP multicast communication.
1 Like

I created an ANE which is a RMTFP rendez-vous server in C++ that I use for my project. It has basic messaging system like when something on the server happens the AS3 side gets notified about which activity occurs. At the moment I only have a working Windows x86 version but porting it to x64 and MacOS should not be that hard. It works pretty well!

It also compiles well for ARM32 and ARM64 but right now redtamarin doesn’t implement ANE kind of mechanism neither ARM architecture.

ok … the question is about if someone can do P2P without a rendez-vous server
so ANE or not, using an ANE would be like replacing the MonaServer the OP said he used before
so you’re replacing a rendez-vous server by another one …

indeed and Redtamarin will not implement ANE at all (that’s why there is a C API)
nor compile for ARM either (not gonna happen, no time)

Can you make the ANE available? Thank you

Yes I can make it available but unfortunately I’m leaving for 3 weeks for vacation we can talk about it personally when I’m back.

Thanks. I think you understand what I mean. Basically, I want to replace the rendez-vous server with a localhost file of connection settings like ip addresses, ports or whatever else is needed. I don’t understand what the rendez-vous server does that’s so special that it can’t be set up manually.

what is needed highly depends on your context, eg. which type of network your clients are connected to

answer that first

if your 2 clients are both connected to your home wifi (LAN)

is not the same as if your 2 clients are connected on the internet
with each client being in 2 different area/city/country etc.

a rendez-vous server is usually a server that is on the internet
so all clients know how/where to connect to it
without having to know each other clients IP address

but knowing IP address in itself is useless
because most computers are behind firewall
and you need to open ports so the connection can pass through

it is not very convenient to ask your users
“please open port 12345 on your firewall so other clients can connect to you”

so the rendez-vous server does that for you
the client connect to it, and because the client initiate the connection to that server
it then can “punch hole” into the firewall
etc.

anyway that’s why to answer your question it is important to know
if you try to do that over LAN or the internet

but you don’t answer that

No LAN. I want to do it on desktop and mobile connected to either wifi or mobile data.

if the 2 clients are connected on the same wifi network
then you can use nc.connect( "rtmfp:" ); as explained above

What about the case where it’s not the same wifi. Is there any way to connect 2 remote AIR clients, just themselves and nothing else?

“what about” … “what if”

look, you re barely giving any details on what you’re trying to do and where
give details godammit

how do you know that?

WHERE

what is the configuration of the network?
what are all the cases?

Thanks for the help. Here’s a use case.

I want to send a message from my AIR directly to a friend on another AIR. I have fast fiber optic internet to a condo and my friend has older slower cable internet with a modem to his house. I’m not sure what the ISPs are doing but we both have routers with admin access. We can go to whatismyip .com and get our IP addresses and open whatever ports. Is there a way to test connection availability of methods based on an IP address:port?

So that’s 2 different networks: “fiber optic internet” and “slower cable internet with a modem”

to use RTMFP/P2P on those types of networks the only way is to use
a rendez-vous server to introduce clients to each other

you can not connect them directly using nc.connect( "rtmfp:" );
that only work on local network (eg. LAN)

another way, knowing the “IP address:port” is to connect directly the clients
with sockets, but that means both users need to open a specific port
on their box/router/firewall/etc. and that create an issue

if you open a specific port on your router then anyone else
can connect to it too

so you could but I would advise against it

so when in Heterogeneous network kind of situation usually you should connect through a 3rd party server

the clients connect to the server
then the messages from/to clients are redirected via the server
that way the clients do not have to open port on their side

also depends on what you try to do
if you just need to chat (mainly send text or small binary for images)
a couple of PHP pages would do

but if you need streaming video/audio, sending big files etc.
there the server using RTMFP/P2P is better

in itself it is just a rendez-vous server, but the way it works
it would connect the clients directly without them having to open ports on their firewall etc.

you can use other techniques but that would require to program the protocol yourself
or find a library etc.

What is the update status of this implementation?

I’m going to try this first hand when beta is available.

Cheers

Thanks for the help. I’ll read more about the risks of opening ports. Servers are expensive and difficult to operate. It would be nice if there was server.