libp2p / libp2p/go-libp2p-http

Upgrading to websockets connection

Open
#94 1 comment 0 reactions 0 assignees View on GitHub

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:

    1. A similar server defines a /hello endpoint and in the HandleFunc it upgrades the connection to websockets (eg using gorilla/websocket).
    1. Request is performed, similar to what is currently being done (eg ("libp2p://16Uiu2HAkuYuv5y1oGQSccX5kxYnW6MDZ2QqPi5y6HjL2baUSDP9W/hello")
    1. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.