Method for Achieving P2P Communication on Webpage
First Claim
1. A method for achieving P2P communication on a webpage, the method comprising the steps of:
- 1) accessing a webpage by a user, calling an interface of a flash plug-in to connect with a socket server, connecting with a stratus server via a netconnection to acquire a key, establishing a connection netconnection and monitoring received messages by the flash, wherein the netconnection being a variable name;
2) sending a username and the key of a source user to the socket server by the flash and storing the username and the key of the source user by the socket server;
3) calling the interface of the flash to send a message including a username of a target user to the socket server by Javascript codes on the webpage of the source user, receiving the message sent by the source user and returning the key corresponding to the username of the target user to the flash on the webpage of the source user by the socket server, and sending a message out via the netconnection and the key of the target user by the flash on the webpage of the source user; and
4) calling a javascript interface on the webpage of the target user to display the message on the webpage of the target user after a flash of the webpage of the target user receives the message.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention relates to the field of network technology, specifically to a method for achieving P2P communication on webpage. The method includes the steps of: 1) accessing a webpage by a user, calling an interface of a flash to connect with a socket server, connecting with a stratus server to acquire a key and monitoring received messages by the flash; 2) sending a username and the key of a source user to the socket server by the flash and storing the username and the key of the source user by the socket server; 3) acquiring the key of the target user from the socket server and sending a message out via the netconnection and the key of the target user by the flash on the webpage of the source user; 4) displaying the message on the webpage of the target user after the flash of the webpage of the target user receives the message. The method can implement p2p communication on webpage, establish connection among the users directly, reduce the pressure on the bandwidth of the server, thereby enhancing communication efficiency and network utilization.
17 Citations
4 Claims
-
1. A method for achieving P2P communication on a webpage, the method comprising the steps of:
-
1) accessing a webpage by a user, calling an interface of a flash plug-in to connect with a socket server, connecting with a stratus server via a netconnection to acquire a key, establishing a connection netconnection and monitoring received messages by the flash, wherein the netconnection being a variable name; 2) sending a username and the key of a source user to the socket server by the flash and storing the username and the key of the source user by the socket server; 3) calling the interface of the flash to send a message including a username of a target user to the socket server by Javascript codes on the webpage of the source user, receiving the message sent by the source user and returning the key corresponding to the username of the target user to the flash on the webpage of the source user by the socket server, and sending a message out via the netconnection and the key of the target user by the flash on the webpage of the source user; and 4) calling a javascript interface on the webpage of the target user to display the message on the webpage of the target user after a flash of the webpage of the target user receives the message. - View Dependent Claims (2, 3, 4)
-
Specification