GithubHelp home page GithubHelp logo

cedric05 / tcp-relay-rust Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 31 KB

Simple tcp proxy using tokio and rust

Home Page: https://crates.io/crates/tcp-relay-rust

Dockerfile 6.39% Rust 93.61%
proxy tcp tcp-proxy tcp-proxy-server socat

tcp-relay-rust's Introduction

Simple tcp relay using rust and tokio

Build

cargo build --release

Run

To create local tcp relay to google.com:443 from localhost:3333.

./target/release/tcp-relay-rust google.com:443 localhost:3333

To try:

curl https://localhost:3333/ -k

Tcp Example

  • start redis server using: docker run --rm -p 6379:6379 redis
  • start relay service: ./target/release/tcp-relay-rust localhost:6379 localhost:3333
  • start client by connecting to redis-cli -p 3333

Unix Example

  • start relay service: ./target/release/tcp-relay-rust /var/run/docker.sock localhost:3333 (danger, its not safe to share docker.sock)
  • invoke sample request by curl localhost:3333

Std Example

  • start relay service: ./target/release/tcp-relay-rust /var/run/docker.sock (danger, its not safe to share docker.sock)
  • type below text. (docker.sock will respond with text) """ GET /containers/json HTTP/1.1 Host: localhost:3333 """

tcp-relay-rust's People

Contributors

cedric05 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.