GithubHelp home page GithubHelp logo

doytsujin / zstd-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fathyb/zstd-proxy

0.0 1.0 0.0 50 KB

High-performance real-time TCP compression

JavaScript 0.11% C++ 11.58% Python 1.65% C 62.86% TypeScript 22.83% Dockerfile 0.97%

zstd-proxy's Introduction

zstd-proxy

High-performance TCP/UNIX proxy with Zstd compression, with Node.js bindings.

Optimized for a low count (< 100) of medium-lived connections (~ 3 minutes) with high-throughput (~ 500Mbps) and low-latency requirements (< 1ms). It uses io_uring on Linux with fixed buffers to transmit without any syscall.

An optional zero-copy send mode can be enabled, but it requires Linux 6 and seems to crash on ARM.

Usage

CLI

  • Create a server on port 9001, compress 9001 to 9002 and decompress 9002 to 9001
$ zstd-proxy --listen=9001 --connect=9002 --compress=listen
  • Create a server on port 9002, compress 9003 to 9002 and decompress 9002 to 9003
$ zstd-proxy --listen=9002 --connect=9003 --compress=connect

Library

  • Create a server on port 9001, compress 9001 to 9002 and decompress 9002 to 9001
import { zstdProxy } from 'zstd-proxy'

createServer({ pauseOnConnect: true })
    .on('connection', server => {
        const client: Socket = connect(9002)
            .on('connect', () => zstdProxy({ compress: server, to: client }))
    })
    .listen(9001)
  • Create a server on port 9002, compress 9003 to 9002 and decompress 9002 to 9003
import { zstdProxy } from 'zstd-proxy'

createServer({ pauseOnConnect: true })
    .on('connection', server => {
        const client: Socket = connect(9003)
            .on('connect', () => zstdProxy({ compress: client, to: server }))
    })
    .listen(9002)

zstd-proxy's People

Contributors

fathyb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.