Commit Graph

147 Commits

Author SHA1 Message Date
Marten Seemann f1109c59c1 use Google's Protobuf library instead of GoGo 2023-01-12 16:43:50 +13:00
Marco Munizaga 1c8eaabfd3
transport.Listener,quic: Support multiple QUIC versions with the same Listener. Only return a single multiaddr per listener. (#1923)
* Revert "transport.Listener  returns a list of multiaddrs"

This reverts commit 8962b2ae33.

* Support multiple QUIC versions on the same listener

* No long running accept loop

* Don't use a goroutine

* PR comments
2022-12-01 14:06:13 -08:00
Marco Munizaga 0b4867c117
feat: quic,webtransport: enable both quic-draft29 and quic-v1 addrs on quic. only quic-v1 on webtransport (#1881)
* transport.Listener  returns a list of multiaddrs

* Support both QUIC versions in QUIC transport

* Support only QUIC v1 in webtransport

* Update dialMatcher

* Update tests

* Only use draft 29 when dialing if the server is a draft 29 server

* Removes QUIC draft 29 addrs if we have a QUIC v1 addr

* Lint fix

* Add changes to deterministic certhashes after rebase

* Update p2p/transport/quic/options.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/listener.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/quic_multiaddr.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Stylize QUIC correctly

* Update doc around ListenClose

* Preallocate a bit extra to avoid paying for an allocation later

* Keep a list of multiaddrs, then join

* PR nits

* Close transport or listener just once

* Update go-multiaddr

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-11-17 10:01:19 -08:00
Marten Seemann 4623690009 switch from github.com/libp2p/go-libp2p-core to core 2022-08-17 17:13:02 +03:00
Marten Seemann 40727b1b00 switch from github.com/libp2p/go-eventbus to p2p/host/eventbus 2022-08-17 12:20:25 +03:00
Marco Munizaga 3517eae205
autonat: fix flaky TestAutoNATPrivate (#1581)
* Use expectEvent and scale duration for CI

* Use 3 seconds
2022-06-02 02:44:02 -07:00
Marten Seemann 8d2e54e163
update go-libp2p-core, remove stream methods from network.Notifiee (#1521) 2022-05-25 06:51:37 -07:00
Marten Seemann 14b1d29f86
autonat: return E_DIAL_REFUSED when skipping dial (#1527)
Co-authored-by: elenaf9 <elena.frank@protonmail.com>
2022-05-25 06:31:12 -07:00
Marten Seemann 3effab121a switch from github.com/libp2p/go-libp2p-swarm to p2p/net/swarm 2022-04-21 13:35:04 +01:00
Marten Seemann fc2c34e045 switch from github.com/libp2p/go-libp2p-blankhost to p2p/host/blank 2022-04-19 14:41:06 +01:00
Marten Seemann 807e6b079a
fix race condition causing TestAutoNATServiceDialError test failure (#1312) 2022-02-06 03:53:53 -08:00
vyzo df2301ba95 use the resource manager in libp2p bundled services, initialize default one 2022-01-18 12:27:07 +04:00
Marten Seemann 5eeba536ea don't use a separate Go module for the autonat tests 2022-01-02 14:47:58 +04:00
Marten Seemann 741348ec9c update import paths to use p2p/host/autonat 2021-12-22 13:26:20 +04:00
Marten Seemann cfb9b36c95 fix flaky TestAutoNATIncomingEvents (#123) 2021-12-22 01:25:55 -08:00
Marten Seemann 09b1f8a5c5 fix flaky TestAutoNATServiceRateLimitJitter (#121) 2021-12-22 00:23:22 -08:00
Marten Seemann c63fd468ac fix flaky tests (#120) 2021-12-21 21:57:15 -08:00
Marten Seemann 2486dd78f9 speed up the tests (#119) 2021-12-21 06:44:15 -08:00
Marten Seemann d70ee3daf2 clean up dialer peerstore after each dial 2021-12-10 13:07:06 +04:00
Marten Seemann 287375a12e chore: update go-log to v2 (#114) 2021-12-06 23:17:31 -08:00
Gus Eggert d2bf1c65e0 feat: plumb through contexts from peerstore (#111) 2021-11-10 11:56:49 -05:00
Marten Seemann 8961023073 remove unused context form autoNATService 2021-08-30 10:31:07 +01:00
Marten Seemann ab4509652c add Close method to interface, fix closing of StaticAutoNAT 2021-08-29 17:33:35 +01:00
Marten Seemann 9002f311d3 remove context from constructor, implement a proper Close method 2021-08-29 16:17:07 +01:00
Marten Seemann a3f631062d add missing stream reset when the server sent the wrong message type 2021-08-25 15:07:11 +01:00
Marten Seemann 21eb6be58e also set a deadline on the stream opened by the client 2021-08-25 15:07:11 +01:00
Marten Seemann a984268d2d set both read and write deadline in the stream handler
A malicious peer could also block writes to a stream (for example by
withholding flow control credit).
2021-08-25 15:07:11 +01:00
Marten Seemann b5fc65dbbe disable failing integration test 2021-08-25 13:38:49 +01:00
Marten Seemann 3d1b86d806 fix staticcheck 2021-05-05 10:23:05 +07:00
Steven Allen 9aafa35759 Merge pull request #99 from libp2p/fix/timeout-incoming-stream-reads
Fix: Stream read timeout
2021-02-25 11:04:21 -08:00
Steven Allen f66422d546 fix: simplify address replacement
We only ever want to dial the remote peer's observed address (to prevent
DoS attacks), so we might as well _always_ replace the reported
addresses with the observed address.

This also fixes a few issues in the original PR:

* Simpler logic.
* Replaces the IP address, not the port. That's what we actually care about.
* Won't accidentally dial "skipped" protocols (e.g., circuit transport).
2021-02-24 17:42:26 -08:00
huoju f9b60bf78d improve readability from the review comments 2021-02-22 12:00:13 -05:00
Ju Huo aab65a0d93 Update svc.go
Co-authored-by: Will <willscott@gmail.com>
2021-02-22 11:38:02 -05:00
huoju 31eb896544 bug fixed. don't jump out of the loop if obsaddr be replaced 2021-02-19 02:08:08 -05:00
huoju f193d0e253 a better implementation to replace the port number for double NAT mapping 2021-02-19 01:13:16 -05:00
huoju bb295a9cc9 replace the port number for double NAT mapping 2021-02-17 23:22:18 -05:00
aarshkshah1992 fad8fa6264 fix: stream read timeout 2020-12-17 11:17:10 +05:30
Steven Allen 87e9356184 chore: update pb 2020-09-02 13:53:14 -07:00
Steven Allen 50313bd7a0 feat: update to go-libp2p-core 0.7.0
This uses the latest stream interface changes.

(it also fixes a bug in the test)
2020-09-02 13:50:55 -07:00
Will Scott ec8d9607cb static nat shouldn't call host.Addrs()
avoid potential call loop
2020-08-03 14:00:45 -04:00
Raúl Kripalani 67e4a6d156 upgrade deps + interoperable uvarint delimited writer/reader. (#95) 2020-07-30 11:25:00 +01:00
Steven Allen 9db24a7d93 fix: a type switch nit 2020-04-29 22:29:06 -07:00
Will Scott 439837bd43 address nits 2020-04-29 18:42:25 -07:00
Will Scott 9e9bcd1344 refactor / separation of events and scheduling 2020-04-23 10:27:15 -07:00
Will Scott 92a3a76d88 clarify dialPolicy comment 2020-04-15 19:43:28 -07:00
Will Scott f6bfa824aa react to incoming events 2020-04-15 19:38:43 -07:00
Will Scott 10fc365206 Run Autonat Service while in unknown connectivity mode
This supports local LAN connectivity / discovery
2020-04-07 10:55:15 -07:00
Will 0d304cb769 factor out dial policy (#62)
factor out dial policy
2020-03-25 11:11:55 -07:00
Will 09d3ae4450 skip dial attempts to non-public peers (#59)
skip dial attempts to non-public peers
fix https://github.com/libp2p/go-libp2p-autonat-svc/issues/33
fix #59
2020-03-23 16:49:48 -07:00
Will Scott 42a3e6f451 switch enablement to not happen in svc constructor 2020-03-19 10:56:55 -07:00