RandyMcMillan
IPFS-hosted 1 Branch 12 Tags
RandyMcMillan Publish repository files to IPFS • …
Loading repository tree...

No file selected. Click a CID in the tree above.

Fetch Content from IPFS Network

Retrieved Data:

None

Node Status

Status: Initializing Helia IPFS Node...

Peer ID: ...

Multiaddrs: ...

Peer

Connect to Peer (e.g. Kubo Desktop)

Click ? for what browsers can dial, how to configure Kubo, and what auto-filled relayed addresses mean.

Share this node (inter-browser)

Copy a link to this node and open it in another browser/tab to connect them. The node exposes a relayed WebRTC address once it has reserved a slot on a relay.

Connected Peers

  • (none)

Connection Help

Browsers cannot open raw TCP or UDP sockets. This Helia node can only dial peers over /ws, /wss, WebTransport, or WebRTC-direct addresses.

If you see "Connection failed: The dial request has no valid addresses", Kubo is probably not listening on a browser-compatible transport.

Quick start (one command)

On the machine running Kubo, run this once from this repo:

npm run kubo:browser
ipfs daemon

This enables everything a browser can dial — WebSocket and WebRTC Direct, on both IPv4 and IPv6. Then return to this page and click Detect Kubo in the Peer → Settings tab: it finds your node, picks an address that works from this page, and connects automatically. No manual copying needed.

Why ws:// does not work from this page

If this app is open from an https:// URL (GitHub Pages), the browser blocks plain ws:// dials as mixed content — even when the target is 127.0.0.1 on your own machine. That is why "websocket is not working by default" here. ws:// dials only succeed when the page itself is served from http://127.0.0.1 or http://localhost (e.g. npm run dev). From https origins, use webrtc-direct (UDP-based, not affected) or wss:// (TLS WebSocket).

Quick setup with npm commands

From this repo, run on the machine hosting Kubo:

# 1. WebRTC Direct (recommended — works from https:// Pages too)
npm run kubo:webrtc
ipfs daemon
# Dial: /ip4/127.0.0.1/udp/4002/webrtc-direct/certhash/uXi.../p2p/<KUBO_PEER_ID>
# (full address is printed by `ipfs id` after restart)

Option A: WebRTC Direct (recommended)

WebRTC Direct runs over UDP and is not subject to mixed-content blocking, so it works both from GitHub Pages and from local dev. Requires Kubo 0.24+ (0.33+ recommended for dial reliability). Kubo generates a self-signed certificate for the listener and advertises the address with a /certhash/uXi… fingerprint — the dial fails without it, so copy the full address.

npm run kubo:webrtc
ipfs daemon
ipfs id    # copy the /ip4/.../udp/4002/webrtc-direct/certhash/.../p2p/... address

Example address (Kubo over IPv6):

/ip6/2602:f9d0:14b:b100:c1:181b:23d3:6d04/udp/4001/webrtc-direct/certhash/uEiCgMO9zfVyrbbTP9tn7C4PWcQTzYBGKVLTK-cY3DvFWuQ/p2p/12D3KooWQX7mvoyyZJDX5uAwezSZoFgHpEGoMrbktw1Vuef1qSeq

Option B: Native Kubo WSS (public nodes)

Kubo can automatically obtain a TLS certificate via AutoTLS. The resulting address uses a *.libp2p.direct domain, so this only works for publicly reachable nodes.

npm run kubo:wss
ipfs daemon
# After the node is online, look for an address like:
# /dns4/<PEER_ID>.libp2p.direct/tcp/443/wss/p2p/<PEER_ID>

Option C: Reverse-proxy WSS (LAN / custom domain)

For local IPs like 192.168.1.74 or your own domain, Kubo cannot use a custom certificate natively. Run a local TLS proxy in front of Kubo's /ws listener instead.

# 1. Start Kubo with a plain /ws listener
npm run kubo:ws
ipfs daemon

# 2. In another terminal, generate a cert and start the proxy
npm run cert:generate      # add CERT_SANS=192.168.1.74 if needed
npm run proxy:wss          # listens on wss://0.0.0.0:4003

# 3. Dial the proxy:
# /ip4/192.168.1.74/tcp/4003/wss/p2p/<KUBO_PEER_ID>

To include a LAN IP in the self-signed certificate, run:

CERT_SANS=192.168.1.74 npm run cert:generate

Plain WebSocket (local dev only)

Plain ws:// works only when this page is served from http://127.0.0.1 / http://localhost (e.g. npm run dev). From https origins it is blocked as mixed content — use Option A instead.

npm run kubo:ws
ipfs daemon
# Dial (dev pages only): /ip4/127.0.0.1/tcp/4002/ws/p2p/<KUBO_PEER_ID>

Which addresses work from a browser?

  • Works everywhere (recommended): /ip4/…/udp/4002/webrtc-direct/certhash/uXi…/p2p/… — works even from https:// Pages origins
  • Works: /dns4/example.com/tcp/443/wss/p2p/... (TLS-proxied Kubo)
  • Works only from http:// dev origins: /ip4/127.0.0.1/tcp/4002/ws/p2p/... — plain ws:// is blocked as mixed content from https pages
  • May work: WebTransport or relayed WebRTC (requires HTTPS except on localhost)
  • Does not work: raw TCP such as /ip4/127.0.0.1/tcp/4001/p2p/...
  • Does not work: QUIC such as /ip4/127.0.0.1/udp/4001/quic-v1/p2p/... — browsers cannot dial QUIC; use webrtc-direct instead

Use ipfs id to see your Kubo peer ID and current addresses.

Kubo RPC Detection

Detect a local Kubo node via its RPC API and copy a browser-dialable multiaddr. The Kubo API must allow CORS from this page's origin.

Enable CORS in Kubo

The page origin depends on how you open the app. Browsers treat 127.0.0.1 and localhost as different origins, so allow both.

Command URL Origin to allow
npm run dev http://127.0.0.1:5173 http://127.0.0.1:5173
npm run dev http://localhost:5173 http://localhost:5173
npm run preview http://127.0.0.1:4173 http://127.0.0.1:4173
GitHub Pages https://yourusername.github.io/ipfs-gh-pages your actual Pages URL

For your current session, allow this origin:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:5173"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]'
ipfs daemon

For persistent access from other origins, allow them all at once:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[
  "http://127.0.0.1:5173",
  "http://localhost:5173",
  "http://127.0.0.1:4173",
  "https://yourusername.github.io"
]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]'
ipfs daemon

Publish Content to IPFS

Result CID:

None