rawproxy

package module
v0.0.0-...-a1843d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2016 License: MIT Imports: 7 Imported by: 0

README

Raw Proxy

A Caddy extension which directly proxies the TCP stream of connections without any additional processing done by Caddy (except for the parsing of the headers). The proxy only connects to the remote server as HTTP/1.1.

This was a quick extension written because Caddy was interfering with one of my web servers which required direct instant receiving and responses without any buffering.

I've only tested this extension with basic HTTP GET requests. I'm not sure if it will work for POST or any other requests. Use at your own risk. I'm more than happy to fix and improve on this extension to support all kinds of requests. Feel free to let me know about any issues.

Installation

  1. go get -u github.com/caddyserver/caddyext
  2. caddyext install --after log rawproxy:github.com/1lann/rawproxy
  3. caddyext build
  4. ./caddy

Usage

In your caddy file, you can specify the following directive:

rawproxy from to {
	except ignored_paths...
}

from is the path to match to proxy from.
to is the IP and port of the server to proxy to.
ignored_paths is an optional space seperated list of paths to exclude from being proxied.

Example configurations
rawproxy / 127.0.0.1:9001

Proxies everything to 127.0.0.1:9001.

rawproxy /cat 127.0.0.1:9001 {
	except /cat/dog
}

Proxies everything matching /cat except for paths matching /cat/dog to 127.0.0.1:9001.

License

Raw Proxy is licensed under The MIT License which can be found here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RawProxy

type RawProxy struct {
	Next httpserver.Handler
	// contains filtered or unexported fields
}

RawProxy represents the rawproxy plugin for Caddy.

func (RawProxy) ServeHTTP

func (c RawProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int,
	error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL