configuration 1: on 192.168.0.92, tonika self address left blank, set
friend's address to 117.35.224.160:44950; on 192.168.0.2, both self
address and friend address left blank.
192.168.0.92 can get index.html from 192.168.0.2, 192.168.0.2 can not
get index.html from 192.168.0.92, message showed in browser: ”Could
not fetch data from Tonika“
configuration 2: on 192.168.0.92, tonika self address
117.35.228.221:39390,set friend's address to 117.35.228.221:44950; on
192.168.0.2, both self address and friend address left blank.
both friends can reach and fetch index.html.
configuration 3: on 192.168.0.92, tonika self address
117.35.237.77:39390, friend's address left blank; on 192.168.0.2, to
nika self address 117.35.237.77:44950, friend's address left blank;
friends can not reach each other.
to reach and fetch from a friend, the friend's external IP is needed.
friends know each other's ID, so a subsystem for look up IP from ID is
needed for p2p network, like DNS system for internet. when a node join
the p2p network, it's ID and external IP is automatically revealled to
the p2p network, and the p2p network could have captured the ID and
external IP and stored it in the p2p network for look up.
the HTTP service of tonkia is over TCP,and in the tests, the NAT and
firewall is already punched for tonika in the configuration for the
ADSL box. but even when each tonika node set its own external public
address IP:port for HTTP service, it seems the information does not
available to the friend node through the p2p network.
I do not know how a tonika node joins the p2p network before friends
could accept invitation , suppose tonika nodes form a Kademlia p2p
network, and each tonika node stores its external public address
IP,UDPport-Kademlia,ID on the p2p network, and IP,UDPport-Kademlia can
be looked up by ID,and then through the friend's IP:UDPport-Kademlia
find services available IP:TCPport-http for HTTP service.
anyway, if there's a method for tonika to lookup friend's external
IP:TCPport-http from friend's ID works well, there will be no such
problem concerned with IP:port resolve.