root/test_projects/socket.html

Revision 7, 0.6 kB (checked in by atack2, 3 years ago)

Added two sockets-related HTML test files. I can't tell if either of them work, but they should be a good start.

Line 
1 <html>
2
3 <head>
4 <title> Regular Sockets test </title>
5 <script>
6
7
8 function doStuff()
9 {
10         // Get us the privileges we need.
11                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
12        
13         var transportService =
14                         Components.classes["@mozilla.org/network/socket-transport-service;1"]
15                                 .getService(Components.interfaces.nsISocketTransportService);
16         var transport = transportService.createTransport(null,0,"localhost",7055,null);
17                
18         var outstream = transport.openOutputStream(0,0,0);
19                 outstream.write("FOO!",4);
20 }
21
22
23
24
25 </script>
26
27 </head>
28
29 <body>
30
31 <input type="button" value="do!" onclick="javascript: doStuff();" />
32
33 </body>
34
35 </html>
Note: See TracBrowser for help on using the browser.