Commit Graph

10 Commits

Author SHA1 Message Date
galargh
50f065b4df chore: fix revive issues 2025-06-11 10:00:47 +01:00
galargh
88d1e102f8 chore: fix golangci-lint errors 2025-06-02 09:51:53 +01:00
Marco Munizaga
3e51326ff1 feat(libp2phttp): More ergonomic auth (#3188) 2025-02-24 16:12:19 -08:00
Marco Munizaga
08f9d22f9b refactor(libp2phttp): don't require specific port for the HTTP host example (#3047) 2024-11-19 14:04:47 -08:00
Marco Munizaga
c378e7f99f HTTP Host implements RoundTripper 2024-06-25 11:46:48 -07:00
Marco Munizaga
46ef49e8de Rename well-known resource (#2757) 2024-04-15 14:10:47 -07:00
Marco Munizaga
a2da8e0269 quic: make server cmd use RFC 9000 instead of draft-29 (#2753)
* quic: make server cmd use RFC 9000 instead of draft-29

* Move code to lib and add a test

* Change example to not rely on specific port

* Replace 0.0.0.0 with localhost

---------

Co-authored-by: Leon Rinkel <leon@rinkel.me>
2024-04-03 07:47:00 -07:00
Marco Munizaga
b8cdb3a11a Use any port, not a specific one for examples (#2748) 2024-03-22 13:08:00 -07:00
Sukun
cea5b4ce17 libp2phttp: fix flaky ExampleHost_listenOnHTTPTransportAndStreams (#2697) 2024-02-01 22:11:26 +05:30
Marco Munizaga
ac038dbf2d feat: Implement HTTP spec (#2438)
* Add SNI and HTTP_libp2p_token to Noise extensions

* Initial libp2phttp work

* Remove custom response writer

* Initial self review

* Add client for PingHTTP

* Support using a different sni from host

* Add WIP auth support

* Revert "Add WIP auth support"

This reverts commit 8a648d94f7. Since
current spec doesn't use libp2p-noise-?X auth anymore.

* Remove libp2p-noise auth (removed from spec)

* wip notes

* Fix ordering of header writes

* Change api to have the host do more

* Add options

* Use stream host from option instead of parameter

* Nits

* Add AddPeerMetadata

* Add CustomRootHandler option

* Remove old todos

* Undo Noise changes

* Add comments

* Implement CloseIdleConnections to protect from surprising behavior

* Add todo

* Add ServerMustAuthenticatePeerID option

* WIP work on recent roundtripper logic

* Remove recentHTTPAddrs. We don't need it

* Move http ping to separate package

* Hide internal constants

* HTTPHost has a valid zero-value. Remove constructor and options

* Add https test

* Rename to following naming convention

* Add flag for insecure http

* Return after error

* Rename Rm to Remove

* Rename

* Refactor to always call closeAllListeners

* Rename

* Rename

* Automatically strip prefix when using SetHTTPHandler*

* Hide streamHostListen

* Cleanup public types and add docs

* Fix interface rename

* Remove debug

* PR comments

* Add examples

* Fix example name

* Cleanup unused example

* Add more examples

* Add well known handler example

* Handle empty path

* Fix typo

* Make RoundTripperOption public so users can allocate a slice of options

* Rename HTTPHost to Host

* Make the host.WellKnownHandler public

* Make Add merge PeerMetadata. Introduce SetPeerMetadata

* Rename AddProtocolMapping to AddProtocolMeta. Expand comment

* Expand comment on DefaultClientRoundTripper

And don't use the http.DefaultRoundTripper and cast

* Remove todo

Covered by https://github.com/libp2p/go-libp2p/issues/2511

* Fix comment typo

* Fix comment typo

* Create helper init fn

* Rename NewRoundTripper to NewConstrainedRoundTripper

* Use pointer for Host.ServeMux

* Don't ignore err

* json decode from reader

* Nits

* Move setupListeners to method

* Add comment for streamReadCloser

* Add more comments

* Add todo

* Defer connect until the round trip

* Rebase gostream

* Update p2p/http/libp2phttp.go

Co-authored-by: Andrew Gillis <gammazero@users.noreply.github.com>

---------

Co-authored-by: Andrew Gillis <gammazero@users.noreply.github.com>
2023-08-28 22:52:02 -07:00