Această pagină a fost actualizată ultima dată în Iunie 2019 .

Language libraries for the BOB API

Diferențe tehnice față de SAMv3

În acest moment, majoritatea ideilor bune de la BOB au fost încorporate în SAMv3, care are mai multe caracteristici și mai multă utilizare reală. BOB încă funcționează, dar acesta nu câștigă funcțiile avansate disponibile pentru SAMv3 și este în esență neacceptat în acest moment.

Alternatives: SAM V3. Older versions: SAM V1, SAM V2,

Prezentare generală

KEYS = cheie publică + privată, acestea sunt BASE64

CHEIE= cheie publică, de asemenea, BASE64

ERROR as is implied returns the message "ERROR "+DESCRIPTION+"\n", where the DESCRIPTION is what went wrong.

OK returns "OK", and if data is to be returned, it is on the same line. OK means the command is finished.

DATA lines contain information that you requested. There may be multiple DATA lines per request.

NOTE: The help command is the ONLY command that has an exception to the rules... it can actually return nothing! This is intentional, since help is a HUMAN and not an APPLICATION command.

Conexiune și versiune

Toată ieșirea de stare BOB este pe linii. Liniile pot fi \n sau \r \n terminate, în funcție de sistem. La conectare, BOB produce două linii:

BOB version
OK

Versiunea curentă este: 00.00.10

Rețineți că versiunile anterioare au folosit cifre hexagonale cu majuscule și nu s-au conformat standardelor de versiune I2P. Se recomandă ca versiunile ulterioare să folosească doar cifrele 0-9. 00.00.10

Istoric versiuni

Versiune Versiunea routerului I2P Schimbări
00.00.10 0.9.8 Versiune curentă
00.00.00 - 00.00.0F   versiuni de dezvoltare

comenzi

PLEASE NOTE: For CURRENT details on the commands PLEASE use the built-in help command. Just telnet to localhost 2827 and type help and you can get full documentation on each command.

Comenzile nu sunt învechite sau schimbate, cu toate acestea, comenzile noi se adaugă din când în când.

COMANDA     operand                             SE INTOARCE
help        (optional command to get help on)   NOTHING or OK and description of the command
clear                                           ERROR or OK
getdest                                         ERROR or OK and KEY
getkeys                                         ERROR or OK and KEYS
getnick     tunnelname                          ERROR or OK
inhost      hostname or IP address              ERROR or OK
inport      port number                         ERROR or OK
list                                            ERROR or DATA lines and final OK
lookup      hostname                            ERROR or OK and KEY
newkeys                                         ERROR or OK and KEY
option      key1=value1 key2=value2...          ERROR or OK
outhost     hostname or IP address              ERROR or OK
outport     port number                         ERROR or OK
quiet                                           ERROR or OK
quit                                            OK and terminates the command connection
setkeys     KEYS                                ERROR or OK and KEY
setnick     tunnel nickname                     ERROR or OK
show                                            ERROR or OK and information
showprops                                       ERROR or OK and information
start                                           ERROR or OK
status      tunnel nickname                     ERROR or OK and information
stop                                            ERROR or OK
verify      KEY                                 ERROR or OK
visit                                           OK, and dumps BOB's threads to the wrapper.log
zap                                             nothing, quits BOB

Once set up, all TCP sockets can and will block as needed, and there is no need for any additional messages to/from the command channel. This allows the router to pace the stream without exploding with OOM like SAM does as it chokes on attempting to shove many streams in or out one socket -- that can't scale when you have alot of connections!

What is also nice about this particular interface is that writing anything to interface to it, is much much easier than SAM. There is no other processing to do after the set up. It's configuration is so simple, that very simple tools, such as nc (netcat) can be used to point to some application. The value there is that one could schedule up and down times for an application, and not have to change the application to do that, or to even have to stop that application. Instead, you can literally "unplug" the destination, and "plug it in" again. As long as the same IP/port addresses and destination keys are used when bringing the bridge up, the normal TCP application won't care, and won't notice. It will simply be fooled -- the destinations are not reachable, and that nothing is coming in.

Exemple

For the following example, we'll setup a very simple local loopback connection, with two destinations. Destination "mouth" will be the CHARGEN service from the INET superserver daemon. Destination "ear" will be a local port that you can telnet into, and watch the pretty ASCII test puke forth.

EXEMPLU DIALOG SESIUNE - telnet simplu 127.0.0.1 2827  lucreaza
A = aplicaţie
C = Răspunsul comenzii BOB.

DIN 	LA	DIALOG
C	A	BOB 00.00.10
C	A	OK
A	C	setnick mouth
C	A	OK Nickname set to mouth
A	C	newkeys
C	A	OK ZMPz1zinTdy3~zGD~f3g9aikZTipujEvvXOEyYfq4Su-mNKerqG710hFbkR6P-xkouVyNQsqWLI8c6ngnkSwGdUfM7hGccqBYDjIubTrlr~0g2-l0vM7Y8nSqtFrSdMw~pyufXZ0Ys3NqUSb8NuZXpiH2lCCkFG21QPRVfKBGwvvyDVU~hPVfBHuR8vkd5x0teMXGGmiTzdB96DuNRWayM0y8vkP-1KJiPFxKjOXULjuXhLmINIOYn39bQprq~dAtNALoBgd-waZedYgFLvwHDCc9Gui8Cpp41EihlYGNW0cu0vhNFUN79N4DEpO7AtJyrSu5ZjFTAGjLw~lOvhyO2NwQ4RiC4UCKSuM70Fz0BFKTJquIjUNkQ8pBPBYvJRRlRG9HjAcSqAMckC3pvKKlcTJJBAE8GqexV7rdCCIsnasJXle-6DoWrDkY1s1KNbEVH6i1iUEtmFr2IHTpPeFCyWfZ581CAFNRbbUs-MmnZu1tXAYF7I2-oXTH2hXoxCGAAAA

FĂȚI NOTĂ DE CHEIA DE DESTINAȚIE SUPLIMENTARĂ, CELE VOR FI DIFERITE!

DIN    LA    DIALOG
A       C     outhost 127.0.0.1
C       A     OK outhost set
A       C     outport 19
C       A     OK outbound port set
A       C     start
C       A     OK tunnel starting

At this point, there was no error, a destination with a nickname of "mouth" is set up. When you contact the destination provided, you actually connect to the CHARGEN service on 19/TCP.

Acum pentru cealaltă jumătate, pentru a putea contacta această destinație.

DIN    LA      DIALOG
C       A       BOB 00.00.10
C       A       OK
A       C       setnick ear
C       A       OK Nickname set to ear
A       C       newkeys
C       A       OK 8SlWuZ6QNKHPZ8KLUlExLwtglhizZ7TG19T7VwN25AbLPsoxW0fgLY8drcH0r8Klg~3eXtL-7S-qU-wdP-6VF~ulWCWtDMn5UaPDCZytdGPni9pK9l1Oudqd2lGhLA4DeQ0QRKU9Z1ESqejAIFZ9rjKdij8UQ4amuLEyoI0GYs2J~flAvF4wrbF-LfVpMdg~tjtns6fA~EAAM1C4AFGId9RTGot6wwmbVmKKFUbbSmqdHgE6x8-xtqjeU80osyzeN7Jr7S7XO1bivxEDnhIjvMvR9sVNC81f1CsVGzW8AVNX5msEudLEggpbcjynoi-968tDLdvb-CtablzwkWBOhSwhHIXbbDEm0Zlw17qKZw4rzpsJzQg5zbGmGoPgrSD80FyMdTCG0-f~dzoRCapAGDDTTnvjXuLrZ-vN-orT~HIVYoHV7An6t6whgiSXNqeEFq9j52G95MhYIfXQ79pO9mcJtV3sfea6aGkMzqmCP3aikwf4G3y0RVbcPcNMQetDAAAA
A       C       inhost 127.0.0.1
C       A       OK inhost set
A       C       inport 37337
C       A       OK inbound port set
A       C       start
C       A       OK tunnel starting
A       C       quit
C       A       OK Bye!

Now all we need to do is telnet into 127.0.0.1, port 37337, send the destination key or host address from addressbook we want to contact. In this case, we want to contact "mouth", all we do is paste in the key and it goes.

NOTĂ: Comanda „quit” din canalul de comandă NU deconectează tunelurile ca SAM.

$ telnet 127.0.0.1 37337
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
ZMPz1zinTdy3~zGD~f3g9aikZTipujEvvXOEyYfq4Su-mNKerqG710hFbkR6P-xkouVyNQsqWLI8c6ngnkSwGdUfM7hGccqBYDjIubTrlr~0g2-l0vM7Y8nSqtFrSdMw~pyufXZ0Ys3NqUSb8NuZXpiH2lCCkFG21QPRVfKBGwvvyDVU~hPVfBHuR8vkd5x0teMXGGmiTzdB96DuNRWayM0y8vkP-1KJiPFxKjOXULjuXhLmINIOYn39bQprq~dAtNALoBgd-waZedYgFLvwHDCc9Gui8Cpp41EihlYGNW0cu0vhNFUN79N4DEpO7AtJyrSu5ZjFTAGjLw~lOvhyO2NwQ4RiC4UCKSuM70Fz0BFKTJquIjUNkQ8pBPBYvJRRlRG9HjAcSqAMckC3pvKKlcTJJBAE8GqexV7rdCCIsnasJXle-6DoWrDkY1s1KNbEVH6i1iUEtmFr2IHTpPeFCyWfZ581CAFNRbbUs-MmnZu1tXAYF7I2-oXTH2hXoxCGAAAA
 !"#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefg
!"#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefgh
"#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghi
#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghij
$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghijk
...

După câțiva kilometri virtuali ai acestui set, apăsați Control-]

...
cdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>[email protected]
defghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>[email protected]
efghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=
telnet> c
Connection closed.

Iată ce s-a întâmplat ...

telnet -> ear -> i2p -> mouth -> chargen -.
telnet <- ear <- i2p <- mouth <-----------'

Te poți conecta și la EEPSITES!

$ telnet 127.0.0.1 37337
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
i2host.i2p
GET / HTTP/1.1

HTTP/1.1 200 OK
Date: Fri, 05 Dec 2008 14:20:28 GMT
Connection: close
Content-Type: text/html
Content-Length: 3946
Last-Modified: Fri, 05 Dec 2008 10:33:36 GMT
Accept-Ranges: bytes

<html>
<head>
  <title>I2HOST</title>
  <link rel="shortcut icon" href="favicon.ico">
</head>
...
<a href="http://sponge.i2p/">--Sponge.</a></pre>
<img src="/counter.gif" alt="[email protected]^7A76Z!#(*&amp;%"> visitors. </body>
</html>
Connection closed by foreign host.
$

Pretty cool isn't it? Try some other well known EEPSITES if you like, nonexistent ones, etc, to get a feel for what kind of output to expect in different situations. For the most part, it is suggested that you ignore any of the error messages. They would be meaningless to the application, and are only presented for human debugging.

Să punem jos destinațiile noastre acum, cu toții că am terminat cu ei.

În primul rând, să vedem ce porecle de destinație avem.

DIN 	LA	DIALOG
A	C	list
C	A	DATA NICKNAME: mouth STARTING: false RUNNING: true STOPPING: false KEYS: true QUIET: false INPORT: not_set INHOST: localhost OUTPORT: 19 OUTHOST: 127.0.0.1
C	A	DATA NICKNAME: ear STARTING: false RUNNING: true STOPPING: false KEYS: true QUIET: false INPORT: 37337 INHOST: 127.0.0.1 OUTPORT: not_set OUTHOST: localhost
C	A	OK Listing done

Bine, acolo sunt. În primul rând, hai să scoatem „gura”.

DIN 	LA	DIALOG
A	C	getnick mouth
C	A	OK Nickname set to mouth
A	C	stop
C	A	OK tunnel stopping
A	C	clear
C	A	OK cleared

Acum pentru a elimina „urechea”, rețineți că acest lucru se întâmplă atunci când tastați prea repede, și vă arată cum arată mesajele EROARE tipice.

DIN 	LA	DIALOG
A	C	getnick ear
C	A	OK Nickname set to ear
A	C	stop
C	A	OK tunnel stopping
A	C	clear
C	A	ERROR tunnel is active
A	C	clear
C	A	OK cleared
A	C	quit
C	A	OK Bye!

Nu mă deranjează să arăt un exemplu de capăt al receptorului unui pod pentru că este foarte simplu. Există două setări posibile pentru acesta și este comutat cu comanda „liniștită”.

The default is NOT quiet, and the first data to come into your listening socket is the destination that is making the contact. It is a single line consisting of the BASE64 address followed by a newline. Everything after that is for the application to actually consume.

In quiet mode, think of it as a regular Internet connection. No extra data comes in at all. It's just as if you are plain connected to the regular Internet. This mode allows a form of transparency much like is available on the router console tunnel settings pages, so that you can use BOB to point a destination at a web server, for example, and you would not have to modify the web server at all.

The advantage with using BOB for this is as discussed previously. You could schedule random uptimes for the application, redirect to a different machine, etc. One use of this may be something like wanting to try to goof up router-to-destination upness guessing. You could stop and start the destination with a totally different process to make random up and down times on services. That way you would only be stopping the ability to contact such a service, and not have to bother shutting it down and restarting it. You could redirect and point to a different machine on your LAN while you do updates, or point to a set of backup machines depending on what is running, etc, etc. Only your imagination limits what you could do with BOB.