npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bittorrent-relay

v15.0.5

Published

Uses the mainline dht to relay requests to other trackers in a swarm

Downloads

40

Readme

bittorrent-relay

We love p2p and we would love to bring the p2p way of doing things to browsers. Browsers can already do p2p connections using webrtc but webrtc connections needs to be initiated using a signaling server. So while browser can have p2p connections using webrtc, that initial signaling server can still have issues. Now think about if your website or service gets very popular, the signaling server may be overloaded with too many connections because of the high traffic and performance might go down if not out right crashing. If we can create swarms of webtorrent trackers, then it creates redunduncy. If 1 tracker goes down, then a browser client can use another tracker in this tracker swarm to connect to other browser clients. If 1 tracker doesn't work, you can see the list of other trackers in the swarm and connect to one of those trackers.

some info

  • This repo uses bittorrent-dht package - this connects us to other trackers using the bittorrent dht (distributed hash table, a distributed-trackerless way to connect to other peers)
  • You must have a server

how it works

  1. bittorrent-relay creates a SHA1 hash of a given "infohash" and connects to other nodes who are sharing that same SHA1 hash.
  2. once bittorrent-relay connects to these other nodes, it shares tracker information with each other such as url.
  3. nodes are then able to make a list of other trackers sharing the same SHA1 hash, and now the list of trackers can be shared and given to regular browser peers
  4. bittorrent-relay also uses websockets to share system usage with each node that way a node can see which other nodes are healthy and fresh

to-do

  1. finish and improve ways nodes can share system usage data
  2. complete the feature to enable users to add other services like gundb

we use the following

bittorrent-dht - gives us the ability to connect to other nodes in a distributed (non-centralized) way

bittorrent-tracker - this repo is based on bittorent-tracker (we made changes to it)

TLDR: Instead of using 1 centralized tracker, we connect multiple trackers into a swarm, that way we can use other trackers in case 1 tracker is out of service.