torproxy

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

README

Torproxy

An easy way to proxy your http requests through the onion network

state release license

NOTE: This is a beta release, we do not consider it completely production ready yet. Use at your own risk.

Route your http requests through the onion network without Tor browser

Using Torproxy

First you need to install the Tor on your machine. Check this page to download and learn how to install Tor: Download Tor

Then install the torproxy using go get:

go get github.com/okkur/torproxy/cmd/torproxy

Create a config file like the below example:

example.test {
  torproxy example.test somewhereonthe.onion 
}

Then run torproxy using this command:

torproxy -conf tor.test

Take a look at our full documentation.

Support

For detailed information on support options see our support guide.

Helping out

Best place to start is our contribution guide.


Code is licensed under the Apache License, Version 2.0.
Documentation/examples are licensed under Creative Commons BY-SA 4.0.
Illustrations, trademarks and third-party resources are owned by their respective party and are subject to different licensing.


Copyright 2019 - The Torproxy authors

Documentation

Index

Constants

View Source
const DefaultOnionServicePort = 4242

DefaultOnionServicePort is the port used to serve the onion service on

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	To     map[string]string
	Client *Tor
}

TorProxy config

func (Config) Proxy

func (c Config) Proxy(w http.ResponseWriter, r *http.Request) error

Proxy redirects the request to the local onion service and the actual proxying happens inside onion service's http handler

type Tor

type Tor struct {
	// Socks5 proxy port
	Port      int
	DataDir   string
	Torrc     string
	DebugMode bool
	LogFile   string
	// contains filtered or unexported fields
}

Tor instance config struct

func (*Tor) ParseTor

func (t *Tor) ParseTor(c *caddy.Controller) error

ParseTor parses advanced config for Tor client

func (*Tor) SetDefaults

func (t *Tor) SetDefaults()

SetDefaults sets the default values for prometheus config if the fields are empty

func (*Tor) Start

func (t *Tor) Start(c *caddy.Controller)

func (*Tor) Stop

func (t *Tor) Stop() error

Stop stops the tor instance, context listener and the onion service

type TorProxy

type TorProxy struct {
	Next   httpserver.Handler
	Config Config
}

func (TorProxy) ServeHTTP

func (rd TorProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

type TorResponse

type TorResponse struct {
	// contains filtered or unexported fields
}

func (*TorResponse) Body

func (t *TorResponse) Body() []byte

Body returns response's body. This method should only get called after WriteBody()

func (*TorResponse) Header

func (t *TorResponse) Header() http.Header

Header returns response headers

func (*TorResponse) ReplaceBody

func (t *TorResponse) ReplaceBody(scheme, to, host string) error

func (*TorResponse) Write

func (t *TorResponse) Write(body []byte) (int, error)

func (*TorResponse) WriteBody

func (t *TorResponse) WriteBody() error

func (*TorResponse) WriteHeader

func (t *TorResponse) WriteHeader(status int)

WriteHeader Writes the given status code to response

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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