libp2p / libp2p/go-libp2p-http
Upgrading to websockets connection
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 68
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
This repo allows HTTP requests via libp2p. I was wondering if it would be possible to reuse that to upgrade the connections to WebSockets, having then an open stream between the client and the libp2p host, so that both can write data to it.
In other words:
-
- A similar server defines a
/helloendpoint and in theHandleFuncit upgrades the connection to websockets (eg using gorilla/websocket).
- A similar server defines a
-
- Request is performed, similar to what is currently being done (eg
("libp2p://16Uiu2HAkuYuv5y1oGQSccX5kxYnW6MDZ2QqPi5y6HjL2baUSDP9W/hello")
- Request is performed, similar to what is currently being done (eg
-
- Client has access to the stream and can read/write data to it.
i) and ii) should be pretty similar to the examples in this repo, but unsure if iii) is possible or if it even makes sense.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the repository's existing libp2p HTTP request and server examples, then trace how a HandleFunc receives and serves a connection. Compare that flow with the proposed /hello upgrade using gorilla/websocket and determine whether the client can retain a bidirectional stream. Done means the feasibility and required API behavior are established, with an example or clear implementation scope if supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100