GithubHelp home page GithubHelp logo

tcp-proxy's Introduction

tcp-proxy

Simple tcp/ip proxy server written in java.

Build

It uses shadowJar jar plugin for making fat-jat. You can build fat-jar with following command:

gradle clean build

This command creates fat-jar under build/libs/tcp-proxy.jar.

Run Application

Application takes three arguments for creating tcp server and connecting to remote host

  • -DremoteHost=remoteServerOrIpAddress
  • -DremotePort=remoteServerPort
  • -DbindAddr=bindAddress
  • -Dport=tcpServerPort
java -DremoteHost=server.tld -DremotePort=10000 -DbindAddr=0.0.0.0 -Dport=5000 -jar tcp-proxy.jar

In the above example application accepts connection on 5000 port on 0.0.0.0 and forwards request to server.tld:10000 and also send server.tld:10000's responses to client

Docker Build

This application also has docker image. You can pull image from https://hub.docker.com/r/oksuz/tcp-proxy/

You can run this image like this:

docker run --name my-tcp-proxy -p5000:5000 -eREMOTE_HOST=server.tld -eREMOTE_PORT=10000 -d oksuz/tcp-proxy

Default exposed port is 5000. It means if you don't provide PORT env. variable default tcp server port is 5000. Also you can provide PORT env variable like this:

docker run --name my-tcp-proxy -p5001:5001 -ePORT=5001 -eREMOTE_HOST=server.tld -eREMOTE_PORT=10000 -d oksuz/tcp-proxy

License

MIT

tcp-proxy's People

Contributors

oksuz avatar wl21st avatar

Watchers

James Cloos 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.