Coder Social home page Coder Social logo

eurocat2k / tcpproxyserver Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

This little application allows TCP connections for clients to access one specific remote TCP server's service read only or for a dedicated host allows a duplex communication.

License: MIT License

JavaScript 100.00%
tcp-connections tcpproxy

tcpproxyserver's Introduction

tcpproxyserver

This little application allows TCP connections for clients to access one specific remote TCP server's service read only or for a dedicated host allows a duplex communication.

Basic usage

There are several ways to start the application:

  • running directly using node' CLI:
    node tcpproxysrv.js -r <address of remote server> -p <port of remote server> [optional arguments]
  • or using pm2 as follows:
pm2 start tcpproxysrv.js -- -r <address of remote server> -p <port of remote server> [optional arguments]
  • or still using pm2's ecosystem configuration file, we can run as follows:
pm2 start --watch ecosystem.config.js

having the * ecosystem configuration file * generated by pm2 init command, and updated it's content:

contents of * ecosystem.config.js *

module.exports = {
  apps: [{
    name: "TCPPROXYSRV",
    script: "tcpproxysrv.js",
    args: "-r <address of remote server> -p <port of remote server> -o <listening port> -x <maximum number of clients>",
    instances: 1,
    autorestart: true
  }]
};

Calling without any argument, the application will output these info below:

tcpproxysrv.js [-D|--duplex] -r|--remote_server <remote address> -p|--remote_port <remote port> \
                [-l|--local_server <local address>] [-o|--local_port <local port>] \
                [-m|--matias_host <matias TTF dcs address>] [-x|--max_clients <#number>] \
                [-G|--get_conf
                
        Where the mandatory arguments are:

                -r|--remote_server - the remote host where the proxy server connects
                -p|--remote_port   - the remote service which is used by proxy server during connection

        the optional arguments are:

                -D|--duplex        - allows MATIAS host to communicate the remote server in duplex mode. Default is false.
                -l|--local_server  - the server listening address where clients can connect. Default is 0.0.0.0
                -o|--local_port    - the server listening service which is transfered to remote server service port. Default is 8739
                -m|--matias_host   - the address of MATIAS TTF DCS IO VLAN address, in duplex mode two way communication allowed for this host
                -G|--get_conf      - lists default configuration options.
                -x|--max_clients   - maximum number of clients allowed to connect to the proxy server. Default is 32

The main goal was to implement a simple TCP proxy and multiplexer for clients, which work with a data stream from remote server. That server allows only one connection at a time to it's service, and only from one dedicated client. I know there are dozens of brilliant solutions to port forward and multiplex a single data stream to several clients. I choosed this one. I'm working in the Air Traffic Control Center, where several services are available for their dedicated clients and/or servers. One of the example is our new AFTN center. It allows bidirectional communications between the center and the ATC systems including the test rig. However for the latter case, it is advised not to pollute the live system with test messages. Our app does not allow by default to write socket connected to the remote server. If so, it is allowed just for the dedicated host * which is actually our test communication server * but as many other attributes during start time, these variables can be customized as required.

tcpproxyserver's People

Contributors

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