Commit Graph

27 Commits

Author SHA1 Message Date
Steven Allen a060bf9eba test: fix flaky example test
If we run the listener async, we might get expected events out of order.
2021-07-22 14:46:15 -07:00
Ian Davis d18fa0f710
Add .gitignore for each example 2021-05-10 11:54:35 +01:00
Steven Allen 9243a830cb chore: fix staticcheck errors 2021-05-07 18:43:57 -07:00
Ian Davis 0343b56ad5
chore: add tests for examples 2021-05-07 14:52:47 +01:00
Ian Davis 76e1ce667e
Fix up example readmes, submodules and gitignore 2021-05-05 11:32:17 +01:00
Ian Davis d340059a80
chore: bring examples back into repository 2021-05-05 10:57:48 +01:00
Steven Allen 0ee6c5a218 extract libp2p examples to go-libp2p-examples
Repo: https://github.com/libp2p/go-lib2p-examples
2018-07-27 11:41:28 -07:00
Steven Allen 41c6834850 refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
2018-06-04 21:22:24 -07:00
Jeromy bbbc040b60 incorporate lgierths opinions 2018-01-07 12:22:05 -08:00
Jeromy 8d84ecd01b functional parameters 2018-01-07 12:22:05 -08:00
Jeromy d04268054f use new constructor for examples 2018-01-07 12:22:05 -08:00
Steven Allen 6b6687f9e4 reset on error in echo 2017-09-13 15:56:55 -07:00
Steven Allen 00cf69eb49 examples/echo: recommend -secio
When not using -secio, this command prints a warning. This confuses users so we
should just tell users to use it in the instructions.

fixes #179
2017-08-30 17:45:45 -07:00
David Dias a8926ed732 docs(examples): small refresh to the echo example 2017-08-19 18:12:11 +02:00
Jeromy 5132c763e3 update example to make it easy to swap out stream muxer 2017-05-13 23:50:46 -07:00
Hector Sanjuan 93802a4007 Add http proxy example
The example proxies http requests through a libp2p stream.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-30 11:14:19 +02:00
Hector Sanjuan 7e11c6008b Docs: Improve echo example
* Do not use testutil to generate random keys and ids since this is a testing
dependency. Use crypto.GenerateKeyPair() instead.
* Echo full lines
* Improve output by telling the user what to run
* More code comments

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-03-22 18:12:18 +01:00
Jeromy Johnson 51ad894515 Merge pull request #181 from zippy/master
more imports cleanup, another dup.
2017-03-08 18:31:49 -08:00
Jeromy ff5be0e63b seed rand for generation of peer IDs in echo example 2017-03-06 23:23:48 -08:00
Eric Harris-Braun 0f0a36c62c more imports cleanup, another dup. 2017-02-22 08:37:38 -05:00
Eric Harris-Braun db919af600 imports cleanup, remove dup 2017-02-21 13:45:42 -05:00
Justin a92558f752 More fixes 2016-11-24 20:54:47 +00:00
Justin 6ac1064a93 Fix port number of echo example 2016-11-24 16:43:52 +00:00
Justin 6e35a38789 More example fixes 2016-11-24 16:35:53 +00:00
Justin b7fdb1f20b Fix path 2016-11-24 16:24:21 +00:00
Hector Sanjuan 7c5d076dc6 Improve echo example:
* Extended explanations and links to relevant godocs
  * Some renames (the host is not dummy, it's a basic)
  * Use addAddr() and let NewStream open the connection

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2016-11-10 12:30:00 +01:00
Lars Gierth f3812decb8 Rename hosts to echo example, remove justtcp example 2016-11-06 04:51:45 +01:00