23 Matching Annotations
  1. May 2023
    1. IPFS can open up to 1000 connections by default and suck up all your bandwidth – and that’s just for exchanging keys with other DHT peers.

      imho, the main problem with IPFS is that it does DHT over TCP, which is crazy-inefficient, compared to bittorrent, which does DHT over UDP, which "just works"

      one reason for DHT over TCP is to make this work in a web browser, which does not support UDP. so instead of teaching web browsers to talk UDP, IPFS took the simple route of "lets take bittorrent and run DHT over TCP"

      IPFS is obsolete, many goals of IPFS can be achieved with bittorrent v2

      generally, treating web browsers as the main target platform (and thus inheriting their limitations) is a bad idea, equally stupid as the "lets run everything in javascript/WASM" idea

    1. 🥳

      ```js import { connect } from 'cloudflare:sockets';

      export default { async fetch(req: Request) { const gopherAddr = "gopher.floodgap.com:70"; const url = new URL(req.url);

      try {
        const socket = connect(gopherAddr);
      
        const writer = socket.writable.getWriter()
        const encoder = new TextEncoder();
        const encoded = encoder.encode(url.pathname + "\r\n");
        await writer.write(encoded);
      
        return new Response(socket.readable, { headers: { "Content-Type": "text/plain" } });
      } catch (error) {
        return new Response("Socket connection failed: " + error, { status: 500 });
      }
      

      } }; ts connect(address: SocketAddress | string, options?: SocketOptions): Socket

      declare interface Socket { get readable(): ReadableStream; get writable(): WritableStream; get closed(): Promise<void>; close(): Promise<void>; startTls(): Socket; }

      declare interface SocketOptions { secureTransport?: string; allowHalfOpen: boolean; }

      declare interface SocketAddress { hostname: string; port: number; } ```

  2. Apr 2023
  3. Mar 2023
  4. Dec 2022
  5. Jun 2022
  6. Jun 2021
  7. Nov 2018
  8. Sep 2015