-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (65 loc) · 3.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<html>
<head>
<title>SockIt · Home</title>
<link href="tutorial.css" rel="stylesheet" type="text/css">
</head>
<body>
<a href="https://github.com/sockit/sockit"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<div class='section'>
<center>
<h1>SockIt · Home</h1>
<h3><a href="downloads.html">Download</a></h3>
<br/>
<br/>
<a href="index.html">Home</a> · <a href="tutorial.html">Quick Tutorial</a> · <a href="full_tutorial.html">Full Tutorial</a> · <a href="demos.html">Demos</a> · <a href="api_documentation.html">API</a> · <a href="html/index.html">Source Documentation</a> · <a href="developers.html">Developers</a>
</center>
<h2>Introduction</h2>
<p>
SockIt is a browser plugin that allows Javascript to perform asynchronous, low-level networking functions.
The API allows web developers to create servers and clients which perform asynchronous network I/O by using Javascript events to perform callbacks.
The API provides access to both TCP and UDP protocols, as well as basic concurrency control for tweaking performance.
</p>
<p>
First, load the plugin:
<pre>
var sockit = loadSockitPlugin();
</pre>
Create a new client to connection <code>google.com</code>:
<pre>
var client = sockit.createTcpClient("www.google.com", 80);
</pre>
Now, we register our client to alert us when it receives a response and send a GET request across the wire:
<pre>
client.addEventListener("data", function(event) {
console.log(event.read());
});
client.send("GET / HTTP/1.0\n\n");
</pre>
And with six lines of javascript, we've created a simple TCP client. <a href="demos/google/google.html">See it in action here.</a>
</p>
<h2>Security Considerations</h2>
<p>
Installing this extension would give any web-page the permissions to make arbitrary TCP/UDP connections from your machine. Treat this as an experimental tool.
</p>
<h2>Installation</h2>
<p>
The plugin is currently packaged for Chrome and Firefox on Windows, Linux. and Mac OSX. To install the plugin, visit the <a href="downloads.html">downloads</a> page.
</p>
<h2>Features</h2>
<p>
The plugin allows creation of TCP and UDP clients and servers, exposes a basic API for controlling each, and allows developers to perform asynchronous I/O with this clients and servers using Javascript event callbacks. Likewise, the API allows
some concurrency control to improve performance, provides hooks to handle additional events such as errors, connection, disconnection, and asynchronously logs errors on the client machine for debugging.
</p>
<h2>Tutorials</h2>
<p>
To see a quick example of the plugin, see the <a href="tutorial.html">quick tutorial</a> or <a href="full_tutorial.html">full tutorial</a>.
</p>
<p>
To learn about everything that the plugin can do, see the <a href="api_documentation.html">API documentation</a>.
</p>
</div><br>
<center>
<a href="index.html">Home</a> · <a href="tutorial.html">Quick Tutorial</a> · <a href="full_tutorial.html">Full Tutorial</a> · <a href="demos.html">Demos</a> · <a href="api_documentation.html">API</a> · <a href="html/index.html">Source Documentation</a> · <a href="developers.html">Developers</a>
</center>
</body>
</html>