Code Monkey home page Code Monkey logo

proxyd's Introduction

proxyd

proxyd proxies data between TCP, TLS, and unix sockets

TLS termination:     Connecting to a remote application's unix socket:
   +---------+         +----------+        +----------+
   |         |         |          |        |          |
->TLS -> TCP |         | -> unix -+------>TLS -> unix |
   |         |         |          |        |          |
   +---------+         +----------+        +----------+
                                                                     _
Proxying through an encrypted pipe:                                 | |
                                       _ __  _ __ _____  ___   _  __| |
   +---------+      +---------+       | '_ \| '__/ _ \ \/ / | | |/ _` |
   |         |      |         |       | |_) | | | (_) >  <| |_| | (_| |
->TCP -------+---> TLS -> TCP |       | .__/|_|  \___/_/\_\\__, |\__,_|
   |         |      |         |       | |                   __/ |
   +---------+      +---------+       |_|                  |___/

Usage

$ proxyd --help
Usage of proxyd:
  -config string
        name of configuration file (default "proxyd_config.json")

proxyd takes a file with a configuration object that describes listeners and proxies. The object is in the form of a ServicePack.

Examples

Listen on a port and forward to another host

[
	{
		"Front": "tcp://0.0.0.0:80",
		"Back": "tcp://192.168.1.2:8080",
	}
]

Accept TCP connections and forward to a local TLS server without verification

[
	{
		"Front": "tcp://0.0.0.0:80",
		"Back": "tls://127.0.0.1:443",
		"BackConfig": {
			"InsecureSkipVerify": "true"
		}
	}
]

Terminate TLS

[
	{
		"Front": "tls://0.0.0.0:443",
		"Back": "tcp://127.0.0.1:80",
		"FrontConfig": {
			"CERT": "-----BEGIN CERTIFICATE-----\n...",
			"KEY": "-----BEGIN RSA PRIVATE KEY-----\n..."
		}
	}
]

Terminate TLS with client certificate verification

Serve the same unix socket on 80 and 443 with TLS

[
	{
		"Front": "tcp://0.0.0.0:80",
		"Back": "unix:///tmp/ipc.sock"
	},
	{
		"Front": "tls://0.0.0.0:443",
		"Back": "unix:///tmp/ipc.sock",
		"FrontConfig": {
			"CERT": "-----BEGIN CERTIFICATE-----\n...",
			"KEY": "-----BEGIN RSA PRIVATE KEY-----\n..."
		}
	}
]

Supported TLS features

Tests

$ go test -race -cover .
ok      github.com/hkparker/proxyd      1.016s  coverage: 59.6% of statements

proxyd's People

Contributors

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