Giter Club home page Giter Club logo

piping-server-rust's Introduction

piping-server

CI Docker Image Size (latest by date)

Piping Server written in Rust

Purpose

Faster Piping Server than ever

  • Faster is better
  • Low memory cost
  • Machine-friendly implementation

Why Rust?

Safe, Fast and No garbage collection (GC)

Run a server

You can choose some ways to run a server.

Way 1: Docker

Run a Piping Server on http://localhost:8181 by the following command.

docker run -p 8181:8080 nwtgck/piping-server-rust

Way 2: Binary for Linux

# Download and extract
curl -L https://github.com/nwtgck/piping-server-rust/releases/download/v0.18.0/piping-server-x86_64-unknown-linux-musl.tar.gz | tar xzf -
# Run on 8181 port
./piping-server-x86_64-unknown-linux-musl/piping-server --http-port=8181

Way 3: Binary for macOS (Intel)

# Download and extract
curl -L https://github.com/nwtgck/piping-server-rust/releases/download/v0.18.0/piping-server-x86_64-apple-darwin.tar.gz | tar xzf -
# Run on 8181 port
./piping-server-x86_64-apple-darwin/piping-server --http-port=8181

Way 4: Binary for macOS (Apple Silicon)

# Download and extract
curl -L https://github.com/nwtgck/piping-server-rust/releases/download/v0.18.0/piping-server-aarch64-apple-darwin.tar.gz | tar xzf -
# Run on 8181 port
./piping-server-aarch64-apple-darwin/piping-server --http-port=8181

Way 5: Windows

https://github.com/nwtgck/piping-server-rust/releases/download/v0.18.0/piping-server-x86_64-pc-windows-gnu.zip

Executable files are available on GitHub Release.

Way 6: Replit

Click Fork button in the link below and fork it.

https://replit.com/@nwtgck/piping-rust

Way 7: Build and run by yourself

You can clone, build and run piping-server as follows.

# Clone
git clone https://github.com/nwtgck/piping-server-rust.git
cd piping-server-rust
# Build
cargo build --release
# Run on 8181 port
./target/release/piping-server --http-port=8181

Server-side help

Piping Server in Rust

Usage: piping-server [OPTIONS]

Options:
      --host <HOST>              Bind address, either IPv4 or IPv6 (e.g. 127.0.0.1, ::1) [default: 0.0.0.0]
      --http-port <HTTP_PORT>    HTTP port [default: 8080]
      --enable-https             Enable HTTPS
      --https-port <HTTPS_PORT>  HTTPS port
      --crt-path <CRT_PATH>      Certification path
      --key-path <KEY_PATH>      Private key path
      --version                  Print version
  -h, --help                     Print help

piping-server-rust's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

piping-server-rust's Issues

Why wait for all receivers to connect?

If.I was sending an infinite "application/octet-stream" stream (e.g. from a webcam) and would like receivers to be able to connect at any point in time while the pipe is still open (imagine I allow it and can handle that in the receivers) what changes would be needed (which part of the code) in order to make it so that it does not wait for all receivers to connect before piping the content? Does it allow that already?

piping-server-rust --enable-https panic

/usr/bin/piping-server --http-port 8888 --enable-https --https-port 8889 --crt-path /home/dns.crt --key-path /home/dns.key
thread 'main' panicked at 'removal index (is 0) should be < len (is 0)', library/alloc/src/vec/mod.rs:1378:13
stack backtrace:
0: 0x7f598af4ba20 -
1: 0x7f598af8171c -
2: 0x7f598af46d15 -
3: 0x7f598af4daeb -
4: 0x7f598af4d5c1 -
5: 0x7f598af4e1b4 -
6: 0x7f598af4dc97 -
7: 0x7f598af4bebc -
8: 0x7f598af4dbf9 -
9: 0x7f598ac4db11 -
10: 0x7f598ac4d916 -
11: 0x7f598ad7a3e4 -
12: 0x7f598ad7a5ee -
13: 0x7f598aca70d8 -
14: 0x7f598acb3938 -
15: 0x7f598aca1137 -
16: 0x7f598acd8788 -
17: 0x7f598acff1c8 -
18: 0x7f598acadb63 -
19: 0x7f598acd09e9 -
20: 0x7f598af4e710 -
21: 0x7f598acff312 -
[root@data4 ~]# /usr/bin/piping-server --help
piping-server 0.10.2
Piping Server in Rust

'Failed to serve HTTP connection' behind reverse proxy

Hi,

I observed that, when running piping-server-rust behind HAProxy, I'm getting the following error after each (successful) transfer:

[ERROR piping_server] Failed to serve HTTP connection: hyper::Error(Shutdown, Os { code: 107, kind: NotConnected, message: "Socket not connected" })
[ERROR piping_server] Failed to serve HTTP connection: hyper::Error(Shutdown, Os { code: 107, kind: NotConnected, message: "Socket not connected" })

I'm not sure what this means, and if this might be related to the timeout parameters. However, I've set timeouts generously and the reverse proxy is running on the same local system as piping-server.

Any ideas?

piping-server-rust hang/lost HTTPS response while runing for a long time

piping-server-rust hang/lost response while runing for a long time(usually several days)

[2022-07-15T09:10:17Z INFO  piping_server] Piping Server (Rust) 0.14.0
[2022-07-15T09:10:17Z INFO  piping_server] HTTP server is running on 8080...
[2022-07-15T09:10:17Z INFO  piping_server] HTTPS server is running on 443...
[2022-07-15T09:10:51Z INFO  piping_server::piping_server] PUT https://pi.selleroa.top/nginx HTTP/2.0
[2022-07-15T09:11:08Z INFO  piping_server::piping_server] GET https://pi.selleroa.top/nginx HTTP/2.0
[2022-07-15T09:11:08Z INFO  piping_server::piping_server] Transfer start: '/nginx'
[2022-07-15T09:11:11Z INFO  piping_server::piping_server] Transfer end: '/nginx'
[2022-07-15T09:31:11Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:31:11Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:31:11Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T09:32:17Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:32:17Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:32:17Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T09:46:26Z INFO  piping_server::piping_server] GET / HTTP/1.1
[2022-07-15T09:47:03Z INFO  piping_server::piping_server] GET https://pi.selleroa.top/nginx HTTP/2.0
[2022-07-15T09:47:04Z ERROR piping_server] Client connection error: tls handshake eof
[2022-07-15T09:47:07Z INFO  piping_server::piping_server] GET https://pi.selleroa.top/ HTTP/2.0
[2022-07-15T09:47:08Z INFO  piping_server::piping_server] GET https://pi.selleroa.top/favicon.ico HTTP/2.0
[2022-07-15T09:47:33Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:47:33Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:47:33Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T09:48:31Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:48:31Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:48:31Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T09:55:40Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:55:40Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:55:40Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T09:57:00Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T09:57:00Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T09:57:00Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T10:01:50Z ERROR piping_server] Client connection error: received corrupt message
[2022-07-15T10:08:17Z ERROR piping_server] Client connection error: received corrupt message
[2022-07-15T10:10:33Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T10:10:33Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T10:10:33Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T10:10:55Z ERROR piping_server] Client connection error: tls handshake eof
[2022-07-15T10:12:13Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T10:12:13Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T10:12:13Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T10:14:40Z INFO  piping_server::piping_server] GET https://www.hljlinuo.com/ HTTP/2.0
[2022-07-15T10:18:17Z WARN  rustls::msgs::handshake] Illegal SNI hostname received [53, 52, 46, 50, 49, 53, 46, 50, 51, 48, 46, 49, 56, 51]
[2022-07-15T10:18:17Z WARN  rustls::conn] Sending fatal alert DecodeError
[2022-07-15T10:18:17Z ERROR piping_server] Client connection error: received corrupt message of type Handshake
[2022-07-15T10:23:04Z ERROR piping_server] Client connection error: received corrupt message
[2022-07-15T10:30:08Z ERROR piping_server] Client connection error: tls handshake eof
[2022-07-15T10:39:01Z ERROR piping_server] Client connection error: tls handshake eof

Mon Jul 18 05:50:23 UTC 2022 now
piping-server 0.14.0

Termux build errors

addeq r12,r11,#(GFp_poly1305_emit-.Lpoly1305_init) ^ /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/ring-0.16.15/pregenerated/poly1305-armv4-linux32.S:185:2: error: out of range immediate fixup value addne r12,r11,#(poly1305_emit_neon-.Lpoly1305_init) ^ /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/ring-0.16.15/pregenerated/poly1305-armv4-linux32.S:187:2: error: out of range immediate fixup value addne r11,r11,#(poly1305_blocks_neon-.Lpoly1305_init) ^ thread 'main' panicked at 'execution failed', /data/data/com.termux/files/home/.cargo/registry/src/github.com-1285ae84e5963aae/ring-0.16.15/build.rs:664:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed

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.