GithubHelp home page GithubHelp logo

tgc's Introduction

TCP Gender Changer Build Status Coverage Status

TCP Gender Changer is a small utility to connect/connect on a local service to a remote server using a listen/listen setup. More information on wikipedia.

This is heavily inspired by http://tgcd.sourceforge.net

Installation

$ go get -u github.com/jfyuen/tgc

Usage

On the node on which to access a server on a LAN, run the connect/connect setup:

$ tgc -C -s ${LOCAL_ADDRESS} -c ${REMOTE_ADDRESS}

On the remote node on which you can connect to, run the listen/listen setup:

$ tgc -L -q ${EXTERNAL_PORT} -p ${LOCAL_PORT}

The remote node now has access to the local server on the LAN via ${LOCAL_PORT}. A connection is initiated to the local server only when data are received from the remote server, unless the -r flag is specified to automatically (re)connect to the local server.

Additionally, a secure connection can be established between the Connect/Connect node and the Listen/Listen node by using the following options for both modes:

  • ca: CA of the connecting party, on the server side, provide the client CA; on the client side, provide the server CA. They can be the same CA
  • crt: x509 cert file signed by the CA provided to the remote node
  • key: key file

Example

Forward local port 8080 to a remote server (${REMOTE}) on port 8000 via port 80. On the local server:

$ tgc -C -s 127.0.0.1:8080 -c ${REMOTE}:80

On the remote server:

$ tgc -L -q ${REMOTE}:80 -p 127.0.0.1:8000

Secure connection between nodes

A script generate_certificates.sh helps create a basic CA, server and client certificate. Give the CN (Common Name) as parameter:

$ ./generate_certificates.sh ${REMOTE}

Forward local port 8080 to a remote server on port 8000 via port 80. On the local server:

$ tgc -C -s 127.0.0.1:8080 -c ${REMOTE}:80 -ca ca.crt -crt client.crt -key client.key

On the remote server:

$ tgc -L -q ${REMOTE}:80 -p 127.0.0.1:8000  -ca ca.crt -crt server.crt -key server.key

tgc's People

Contributors

jfyuen avatar

Stargazers

JB KOPECKY avatar Marcos A. Acevedo avatar Ricardo Amaro avatar

Watchers

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