1234567891011121314151617181920212223242526272829303132333435363738 |
- <!DOCTYPE HTML>
- <html lang="en">
- <head>
- <title>Peer Test</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="Content-Language" content="en-us">
- <meta name="description" content="">
- <meta name="keywords" content="">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
- <script type="text/javascript" src="/peer.js"></script>
- <script>
- $(document).ready(function() {
- originator = new Peer('michelle', { key: 'r6l1dggn5hebqpvi', host: 'localhost', port: '9000', debug: true });
- originator.on('open', function(id) {
- console.log(id);
- });
- originator.on('error', function(msg) {
- console.log(msg);
- });
- originator.on('connection', function(connection) {
- x = connection;
- console.log('connection');
- connection.on('data', function(data) {
- console.log(data);
- });
- connection.send('What is going on?');
- });
- });
- </script>
- </head>
-
- <body>
- This is a P2P peer.
- </body>
- </html>
|