forked from I2P_Developers/i2p.i2p
initial import of Connelly's public domain I2P python lib
This commit is contained in:
33
apps/sam/python/doc/guide/eeproxy.html
Normal file
33
apps/sam/python/doc/guide/eeproxy.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>Eeproxy - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>Eeproxy</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
The <strong>Eeproxy</strong> is run by the I2P router. The proxy is normally used for web browsers, as a means of accessing eepsites.
|
||||
|
||||
|
||||
<p>
|
||||
The eeproxy is usually available at <a href="http://127.0.0.1:4444/" class='printable' title="http://127.0.0.1:4444/">http://127.0.0.1:4444/</a>.
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
</em><!-- Time since request: 0.77 secs. -->
|
||||
</body></html>
|
||||
55
apps/sam/python/doc/guide/i2p.eep.html
Normal file
55
apps/sam/python/doc/guide/i2p.eep.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>User's Guide:i2p.eep - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>User's Guide:i2p.eep</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
Module <code >i2p.eep</code > allows Python programs to access the <a href="./eeproxy.html" class='printable' title ="Eeproxy">Eeproxy</a>.
|
||||
|
||||
|
||||
<p>
|
||||
With this module, a program can easily download eepsites.
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Functions"> Functions </a></h2>
|
||||
|
||||
<p>
|
||||
<strong>urlopen</strong>(url, eepaddr='127.0.0.1:4444')
|
||||
<ul >
|
||||
|
||||
<pre> Like urllib2.urlopen(url), but only works for eep-sites.
|
||||
Example: f = urlopen('<a href="http://duck.i2p/index.html" class='printable' title="http://duck.i2p/index.html">http://duck.i2p/index.html</a>')
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>urlget</strong>(url, eepaddr='127.0.0.1:4444')
|
||||
<ul >
|
||||
|
||||
<pre> Get contents of an eepsite.
|
||||
Example: urlget('<a href="http://duck.i2p/" class='printable' title="http://duck.i2p/">http://duck.i2p/</a>').
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
|
||||
</em><!-- Time since request: 0.78 secs. -->
|
||||
</body></html>
|
||||
61
apps/sam/python/doc/guide/i2p.html
Normal file
61
apps/sam/python/doc/guide/i2p.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>User's Guide:i2p - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>User's Guide:i2p</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
Package <code >i2p</code > is a container package for more specific modules.
|
||||
|
||||
|
||||
<p>
|
||||
It exports the following names:
|
||||
<ul >
|
||||
|
||||
<pre> <a href="./i2p.sam.html" class='printable' title ="User's Guide:i2p.sam">sam</a>
|
||||
<a href="./i2p.eep.html" class='printable' title ="User's Guide:i2p.eep">eep</a>
|
||||
<a href="./i2p.router.html" class='printable' title ="User's Guide:i2p.router">router</a>
|
||||
<a href="#Error" class='printable' title ="User's Guide:i2p">Error</a>
|
||||
<a href="#RouterError" class='printable' title ="User's Guide:i2p">RouterError</a>
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
class <strong>Error</strong>(Exception):
|
||||
<ul >
|
||||
|
||||
<pre> Base class for all I2P errors.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
class <strong>RouterError</strong>(Error):
|
||||
|
||||
<ul >
|
||||
|
||||
<pre> Could not connect to router.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
</em><!-- Time since request: 0.85 secs. -->
|
||||
|
||||
</body></html>
|
||||
87
apps/sam/python/doc/guide/i2p.router.html
Normal file
87
apps/sam/python/doc/guide/i2p.router.html
Normal file
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>User's Guide:i2p.router - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>User's Guide:i2p.router</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
Module <code >i2p.sam</code > allows Python programs to control the I2P router.
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Functions"> Functions </a></h2>
|
||||
|
||||
<p>
|
||||
<strong>check</strong>(dir=None)
|
||||
<ul ><pre>
|
||||
Checks whether a locally installed router is running. Does
|
||||
nothing if successful, otherwise raises i2p.RouterError.
|
||||
|
||||
An I2P installation is located by using find(dir).
|
||||
The router.config file is parsed for 'router.adminPort'.
|
||||
This port is queried to determine whether the router is
|
||||
running.
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>find</strong>(dir=None)
|
||||
<ul ><pre>
|
||||
|
||||
Find the absolute path to a locally installed I2P router.
|
||||
|
||||
An I2P installation is located by looking in the
|
||||
environment I2P, then in PATH, then in the dir argument
|
||||
given to the function. It looks for startRouter.sh or
|
||||
startRouter.bat. Raises ValueError if an I2P installation
|
||||
could not be located.
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>start</strong>(dir=None, hidden=False)
|
||||
<ul ><pre>
|
||||
Start a locally installed I2P router. Does nothing if
|
||||
the router has already been started.
|
||||
|
||||
An I2P installation is located by using find(dir).
|
||||
|
||||
If hidden is True, do not show a terminal for the router.
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>stop</strong>(dir=None, force=False)
|
||||
<ul ><pre>
|
||||
Stop a locally installed I2P router, if it was started by
|
||||
the current Python program. If force is True, stop the
|
||||
router even if it was started by another process. Do nothing
|
||||
if force is False and the router was started by another program.
|
||||
|
||||
The file 'router.config' is located using the same search
|
||||
process used for find(dir). It is parsed for
|
||||
'router.shutdownPassword' and 'router.adminPort'. The
|
||||
router is shut down through the admin port.
|
||||
|
||||
Raises i2p.RouterError if the I2P router is running but cannot
|
||||
be stopped. You must uncomment the
|
||||
'router.shutdownPassword' line for this command to work.
|
||||
</pre>
|
||||
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
</em><!-- Time since request: 0.77 secs. -->
|
||||
</body></html>
|
||||
308
apps/sam/python/doc/guide/i2p.sam.html
Normal file
308
apps/sam/python/doc/guide/i2p.sam.html
Normal file
@@ -0,0 +1,308 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>User's Guide:i2p.sam - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>User's Guide:i2p.sam</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'><a name="top"></a>
|
||||
Module <code >i2p.sam</code > allows Python programs to access the <a href="./samproxy.html" class='printable' title ="SAM proxy">SAM proxy</a>.
|
||||
|
||||
|
||||
<p>
|
||||
With this module, a program can send stream data, datagrams, and raw packets across the I2P network.
|
||||
|
||||
<p>
|
||||
|
||||
<p><table border="0" id="toc"><tr><td align="center">
|
||||
<b>Table of contents</b></td></tr><tr id='tocinside'><td>
|
||||
<div style="margin-bottom:0px;">
|
||||
<A CLASS="internal" HREF="#Sockets">1 Sockets</A><BR>
|
||||
</div>
|
||||
<div style="margin-bottom:0px;">
|
||||
<A CLASS="internal" HREF="#Tunnels">2 Tunnels</A><BR>
|
||||
</div>
|
||||
<div style="margin-left:2em;">
|
||||
<A CLASS="internal" HREF="#Tunnel_Server">2.1 Tunnel Server</A><BR>
|
||||
|
||||
<A CLASS="internal" HREF="#Tunnel_Client">2.2 Tunnel Client</A><BR>
|
||||
</div>
|
||||
<div style="margin-bottom:0px;">
|
||||
<A CLASS="internal" HREF="#Errors">3 Errors</A><BR>
|
||||
</div>
|
||||
<div style="margin-bottom:0px;">
|
||||
<A CLASS="internal" HREF="#Constants">4 Constants</A><BR>
|
||||
</div>
|
||||
</td></tr></table><P>
|
||||
<h2><a name="Sockets"> Sockets </a></h2>
|
||||
|
||||
<p>
|
||||
|
||||
<strong>socket</strong>(session, type, samaddr='127.0.0.1:7656', **kwargs)
|
||||
<ul ><pre>
|
||||
Create a new socket. Argument session should be a session
|
||||
name -- if the name has not yet been used, an I2P
|
||||
Destination will be created for it, otherwise, the
|
||||
existing Destination will be re-used. An empty session
|
||||
string causes a transient session to be created. Argument
|
||||
type is one of SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW.
|
||||
|
||||
I2P configuration keyword arguments:
|
||||
|
||||
* in_depth - depth of incoming tunnel (default 2)
|
||||
* out_depth - depth of outgoing tunnel (default 2)
|
||||
|
||||
A single session may be shared by more than one socket, if
|
||||
the sockets are the same type, and if the sockets are
|
||||
created within the same Python process. The socket
|
||||
objects are multithread-safe.
|
||||
|
||||
Examples:
|
||||
a = i2p.socket('Alice', i2p.SOCK_STREAM)
|
||||
b = i2p.socket('Bob', i2p.SOCK_DGRAM,
|
||||
in_depth=2, out_depth=5)
|
||||
|
||||
The created object behaves identically to a socket from
|
||||
module socket, with the following exceptions:
|
||||
|
||||
* I2P Destinations are used as address arguments [1].
|
||||
* bind is a no-op: sockets are always bound.
|
||||
* send* methods send all data and are non-blocking.
|
||||
|
||||
A given session name can only be open in a single Python
|
||||
program at a time. If you need to overcome this
|
||||
limitation, consider patching I2P.
|
||||
|
||||
[1]. Alternatively, a host name can be used as an address.
|
||||
It will be resolved using hosts.txt.
|
||||
|
||||
For details on how to use socket objects, see
|
||||
http://www.python.org/doc/current/lib/socket-objects.html
|
||||
|
||||
See the examples directory for code examples.
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>socket()</strong> object properties:
|
||||
<ul >
|
||||
|
||||
<pre> dest - Local I2P Destination of socket
|
||||
session - Session name
|
||||
type - Socket type: SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW.
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>poll</strong>()
|
||||
|
||||
<ul >
|
||||
|
||||
<pre> Returns a polling object. Works on SAM sockets and Python sockets.
|
||||
See <a href='http://www.python.org/doc/current/lib/module-select.html' class='printable' title="http://www.python.org/doc/current/lib/module-select.html">select.poll()</a> in the Python library for more information.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
<strong>resolve</strong>(host, samaddr='127.0.0.1:7656')
|
||||
<ul >
|
||||
|
||||
<pre> Resolve I2P host name --> I2P Destination.
|
||||
Returns the same string if host is already a Destination.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
<strong>select</strong>(readlist, writelist, errlist, timeout=None)
|
||||
<ul >
|
||||
|
||||
<pre> Performs a select call. Works on SAM sockets and Python sockets.
|
||||
See <a href='http://www.python.org/doc/current/lib/module-select.html' class='printable' title="http://www.python.org/doc/current/lib/module-select.html">select.select()</a> in the Python library for more information.
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Tunnels"> Tunnels </a></h2>
|
||||
|
||||
<p>
|
||||
Tunnels allow stream sockets to be joined, so that connections to a listening socket are relayed to one or more sending sockets. This allows an ordinary web server to be exposed as an I2P Destination, or an I2P Destination to be bound as a local port, and so on.
|
||||
|
||||
<p>
|
||||
class <strong>Tunnel</strong>(self, receive, make_send, nconnect=-1, timeout=60.0)
|
||||
<ul ><pre>
|
||||
A Tunnel relays connections from a 'receive' socket to one
|
||||
or more 'send' sockets. The receive socket must be bound
|
||||
and listening. For each incoming connection, a new send
|
||||
socket is created by calling make_send(). Data is then
|
||||
exchanged between the created streams until one socket is
|
||||
closed. nconnect is the maximum number of simultaneous
|
||||
connections (-1 for infinite), and timeout is the time that
|
||||
a single connection can last for (None allows a connection
|
||||
to last forever).
|
||||
|
||||
Sockets must accept stream traffic and support the Python
|
||||
socket interface. A separate daemonic thread is created to
|
||||
manage the tunnel. For high performance, make_send() should
|
||||
make a socket and connect in non-blocking mode (you should
|
||||
catch and discard the sam.BlockError or socket.error due to
|
||||
executing connect on a non-blocking socket).
|
||||
|
||||
Security Note:
|
||||
A firewall is needed to maintain the end user's anonymity.
|
||||
An attacker could keep a tunnel socket open by pinging it
|
||||
regularly. The accepted sockets from 'receive' must prevent
|
||||
this by closing down eventually.
|
||||
|
||||
Socket errors do not cause the Tunnel to shut down.
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
<strong>close</strong>()
|
||||
<ul >
|
||||
|
||||
<pre> Close all connections made for this tunnel.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h3><a name="Tunnel_Server"> Tunnel Server </a></h3>
|
||||
|
||||
<p>
|
||||
class <strong>TunnelServer</strong>(session, port, samaddr='127.0.0.1:7656', nconnect=-1, timeout=None, **kwargs)
|
||||
<ul ><pre>
|
||||
Tunnels incoming SAM streams --> localhost:port.
|
||||
|
||||
nconnect and timeout are the maximum number of connections
|
||||
and maximum time per connection. All other arguments are
|
||||
passed to sam.socket(). This call blocks until the tunnel
|
||||
is ready.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
<strong>TunnelServer</strong> properties:
|
||||
|
||||
<ul ><pre>
|
||||
dest - I2P Destination of server.
|
||||
session - Session name for server.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h3><a name="Tunnel_Client"> Tunnel Client </a></h3>
|
||||
|
||||
<p>
|
||||
class <strong>TunnelClient</strong>(session, port, dest, samaddr='127.0.0.1:7656', nconnect=-1, timeout=None, **kwargs)
|
||||
<ul ><pre>
|
||||
|
||||
Derived from Tunnel.
|
||||
Tunnels localhost:port --> I2P Destination dest.
|
||||
|
||||
A session named 'session' is created locally, for purposes
|
||||
of routing to 'dest'. nconnect and timeout are the maximum
|
||||
number of connections and maximum time per connection. All
|
||||
other arguments are passed to sam.socket(). This call blocks
|
||||
until the tunnel is ready.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
<strong>TunnelClient</strong> properties:
|
||||
<ul ><pre>
|
||||
dest - Local Destination used for routing.
|
||||
remotedest - Remote Destination.
|
||||
session - Session name for local Destination.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Errors"> Errors </a></h2>
|
||||
|
||||
<p>
|
||||
class <strong>Error</strong>(i2p.Error)
|
||||
<ul ><pre>
|
||||
Base class for all SAM errors.
|
||||
</pre>
|
||||
</ul >
|
||||
class <strong>BlockError</strong>(Error)
|
||||
|
||||
<ul ><pre>
|
||||
Socket call would have blocked.
|
||||
</pre>
|
||||
</ul >
|
||||
class <strong>ClosedError</strong>(Error)
|
||||
<ul ><pre>
|
||||
A command was used on a socket that closed gracefully.
|
||||
</pre>
|
||||
</ul >
|
||||
class <strong>NetworkError</strong>(Error)
|
||||
<ul ><pre>
|
||||
|
||||
Network error occurred within I2P.
|
||||
|
||||
The error object is a 2-tuple: (errtag, errdesc).
|
||||
errtag is a SAM error string,
|
||||
errdesc is a human readable error description.
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Constants"> Constants </a></h2>
|
||||
|
||||
<p>
|
||||
<strong>Socket types</strong>
|
||||
<ul ><pre>
|
||||
SOCK_STREAM = 1
|
||||
SOCK_DGRAM = 2
|
||||
SOCK_RAW = 3
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>Packet sizes</strong>
|
||||
<ul ><pre>
|
||||
MAX_DGRAM = 31744 # Maximum size for datagram packet
|
||||
MAX_RAW = 32768 # Maximum size for raw packet
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>Flags for recv()</strong>
|
||||
<ul ><pre>
|
||||
MSG_DONTWAIT = 128 # Don't block
|
||||
MSG_PEEK = 2 # Peek at incoming data
|
||||
MSG_WAITALL = 64 # Wait for all data or error
|
||||
</pre>
|
||||
</ul >
|
||||
<strong>Polling flags</strong>
|
||||
|
||||
<ul ><pre>
|
||||
POLLIN = 1
|
||||
POLLOUT = 4
|
||||
POLLERR = 8
|
||||
POLLHUP = 16
|
||||
POLLNVAL = 32
|
||||
POLLPRI = 1
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
</em><!-- Time since request: 0.86 secs. -->
|
||||
</body></html>
|
||||
76
apps/sam/python/doc/guide/index.html
Normal file
76
apps/sam/python/doc/guide/index.html
Normal file
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>Main Page - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>Main Page</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
<strong>Python-I2P</strong> is a Python interface to <a href='http://www.i2p.net' class='printable' title="http://www.i2p.net">I2P</a>.
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="Quick_Start"> Quick Start </a></h2>
|
||||
|
||||
<p>
|
||||
Install:
|
||||
|
||||
<p>
|
||||
<ul ><pre>
|
||||
python setup.py install
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
Use:
|
||||
|
||||
<p>
|
||||
|
||||
<ul ><pre>
|
||||
>>> from i2p import sam
|
||||
>>> s = sam.socket('Alice', sam.SOCK_STREAM)
|
||||
>>> s.connect('duck.i2p')
|
||||
>>> s.send('GET / HTTP/1.0\r\n\r\n')
|
||||
>>> s.recv(1000)
|
||||
(HTTP response from duck.i2p)
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
|
||||
<h2><a name="User's_Guide"> User's Guide </a></h2>
|
||||
|
||||
<p>
|
||||
The following modules are available:
|
||||
|
||||
<p>
|
||||
<ul >
|
||||
|
||||
<pre> <a href="./i2p.html" class='printable' title ="User's Guide:i2p">i2p</a> (Container package)
|
||||
<a href="./i2p.sam.html" class='printable' title ="User's Guide:i2p.sam">i2p.sam</a> (Send and receive across the I2P network)
|
||||
<a href="./i2p.eep.html" class='printable' title ="User's Guide:i2p.eep">i2p.eep</a> (Retrieve eepsites)
|
||||
<a href="./i2p.router.html" class='printable' title ="User's Guide:i2p.router">i2p.router</a> (Manage the I2P router)
|
||||
|
||||
</pre>
|
||||
</ul >
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
</em><!-- Time since request: 0.78 secs. -->
|
||||
</body></html>
|
||||
37
apps/sam/python/doc/guide/samproxy.html
Normal file
37
apps/sam/python/doc/guide/samproxy.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en"><head><title>SAM proxy - Wikipedia</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="index,follow">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<script type="text/javascript" src="/~barnesc/wiki/stylesheets/wikibits.js"></script>
|
||||
<style type='text/css'><!--
|
||||
@import url("/~barnesc/wiki/stylesheets/wikiprintable.css");
|
||||
/*/*/
|
||||
a.new, #quickbar a.new { color: #CC2200; }
|
||||
#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }
|
||||
#article { margin-left: 152px; margin-right: 4px; }
|
||||
/* */
|
||||
//--></style>
|
||||
</head>
|
||||
|
||||
<body bgcolor='#FFFFFF' onload=''>
|
||||
<h1 class='pagetitle'>SAM proxy</h1><p class='subtitle'>From Python-I2P.
|
||||
|
||||
|
||||
<div class='bodytext'>
|
||||
A <strong>SAM proxy</strong> is run by the I2P router. The proxy allows streams, datagrams, and raw packets to be sent through the I2P network. A client application uses a telnet-like session to communicate with the proxy. In this way, the core features of the I2P library can be used by any language.
|
||||
|
||||
|
||||
<p>
|
||||
The protocol used for SAM is described in <a href='http://dev.i2p.net/pipermail/i2p/2004-July/000353.html' class='printable' title="http://dev.i2p.net/pipermail/i2p/2004-July/000353.html">SAM 1.0</a>.
|
||||
|
||||
<p>
|
||||
In practice, a <em>SAM library</em> is usually written, so that client applications do not need to use the low-level SAM commands.
|
||||
|
||||
<p>
|
||||
</div>
|
||||
<p><em>
|
||||
|
||||
</em><!-- Time since request: 0.77 secs. -->
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user