Git Product home page Git Product logo

jankammerath / torgate Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 4.0 1.94 MB

A reverse proxy for the Onion-network and an alternative to Tor2Web written in C++ using microhttpd and curl as well as the tor socks5 proxy. Onion URLs can be access by a domain extension like torgate.test.

License: Apache License 2.0

Dockerfile 1.66% Makefile 0.64% CSS 1.65% HTML 15.45% C++ 80.60%
tor onion linux server gateway darknet deepweb proxy proxy-server reverse-proxy

torgate's Introduction

torgate

Torgate is a reverse HTTP proxy to access Onion-websites through the Tor network. It is written in C++ for Linux using libmicrohttpd, libcurl and libconfig++. To use torgate you need a Linux operating system and a DNS server or DNS entry with a wildcard to your domain that is then appended to the .onion address. Torgate is very similar to Tor2Web, but written in C++ supporting multi-threading. It also supports Cookies, HTTP POST and header forwarding.

Screenshot of torgate in Docker with Firefox using it

How to install

Torgate is in the early stages and installation requires compiling the software yourself using the Makefile. However to make things easier, the repository contains a Dockerfile and a docker-compose.yml file which allow you to quickly run Torgate through Docker. If you however are unfamiliar with Docker, it is recommended to install torgate on your Linux box.

Run on Docker

If you wish to run torgate through Docker, then download the repository and its files either as a ZIP-file or through git. Then just execute docker-compose as below and a container with torgate including the tor client with its socks proxy will be started. The container is configured to run out of the box.

$ git clone https://github.com/jankammerath/torgate.git
$ cd torgate/
$ docker-compose up

Install on Ubuntu Bionic 18.04

There is no installation, yet and the Makefile does not have an install recipe. However you can easily install torgate with the following commands. These also include the libraries required as well as the tor client and socks proxy.

$ cd /usr/src/
$ git clone https://github.com/jankammerath/torgate.git
$ cd torgate/
$ cp config/torrc /etc/tor/torrc
$ cp config/torgate.conf /etc/torgate.conf
$ cp -R html /var/torgate/html
$ make

Now run torgate by just executing it.

$ torgate

Please see the configuration section for further necessary configuration, especially of your DNS server. Currently the application is not daemonized, so you would have to configure a service yourself or simply run it in the background.

Configuration

You need to configure your DNS in order for torgate to work. By default the TLD or domain for torgate to append to .onion-Domains is torgate.test. The following line is required to be added to your DNS server. The example shows the configuration for the dnsmasq DNS server.

address=/torgate.test/192.168.1.1

torgate.conf

The torgate.conf files holds further configuration options.

  1. port (default: 80) the port that the torgate HTTP server runs on

  2. tld (default: torgate.test) the tld that torgate appends to the onion domains

  3. proxyHost (default: 127.0.0.1) the host address of the tor socks proxy

  4. proxyPort (default: 9050) the port of the tor socks proxy

  5. userAgent (default: Torgate/0.1) the user agent torgate identifies towards onion hosts

  6. verboseClient (default: false) if true, libcurl will produce verbose output

  7. serverBanner (default: Torgate/0.1) the server header that torgate responds with

  8. localPath (default: /var/torgate/html) the path where the html files are stored

torgate's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

torgate's Issues

dependencies for fedora-33

Just mentioning, cause it took me some time to find the necessary packages:

sudo dnf install g++ libcurl-devel libconfig-devel libmicrohttpd-devel

And it seems you have to pass -fpermissive to g++ (i.e. in the Makefile), to allow the compilation to go through. Or to fix the "invalid conversion error".

make fails when building docker

src/class/HttpServer.cpp: In member function 'void HttpServer::start()':
src/class/HttpServer.cpp:30:48: error: invalid conversion from 'int ()(void, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**)' {aka 'int ()(void, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)'} to 'MHD_AccessHandlerCallback' {aka 'MHD_Result ()(void, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)'} [-fpermissive]
30 | this->port, NULL, NULL, &HttpServer::handleRequest, this->handler, MHD_OPTION_END);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int ()(void, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**) {aka int ()(void, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)}
In file included from src/class/HttpServer.cpp:2:
/usr/include/microhttpd.h:2701:45: note: initializing argument 5 of 'MHD_Daemon* MHD_start_daemon(unsigned int, uint16_t, MHD_AcceptPolicyCallback, void*, MHD_AccessHandlerCallback, void*, ...)'
2701 | MHD_AccessHandlerCallback dh, void dh_cls,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
src/class/HttpServer.cpp: In static member function 'static int HttpServer::handleRequest(void
, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**)':
src/class/HttpServer.cpp:67:29: error: invalid conversion from 'int ()(void, MHD_ValueKind, const char*, const char*)' to 'MHD_KeyValueIterator' {aka 'MHD_Result ()(void, MHD_ValueKind, const char*, const char*)'} [-fpermissive]
67 | HttpServer::attachGetParameters, &requestHttpHeaderList);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
| |
| int ()(void, MHD_ValueKind, const char*, const char*)
In file included from src/class/HttpServer.cpp:2:
/usr/include/microhttpd.h:3048:49: note: initializing argument 3 of 'int MHD_get_connection_values(MHD_Connection*, MHD_ValueKind, MHD_KeyValueIterator, void*)'
3048 | MHD_KeyValueIterator iterator,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
src/class/HttpServer.cpp:77:29: error: invalid conversion from 'int ()(void, MHD_ValueKind, const char*, const char*)' to 'MHD_KeyValueIterator' {aka 'MHD_Result ()(void, MHD_ValueKind, const char*, const char*)'} [-fpermissive]
77 | HttpServer::attachGetParameters, &getParamList);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
| |
| int ()(void, MHD_ValueKind, const char*, const char*)
In file included from src/class/HttpServer.cpp:2:
/usr/include/microhttpd.h:3048:49: note: initializing argument 3 of 'int MHD_get_connection_values(MHD_Connection*, MHD_ValueKind, MHD_KeyValueIterator, void*)'
3048 | MHD_KeyValueIterator iterator,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
make: *** [Makefile:6: all] Error 1
The command '/bin/sh -c make' returned a non-zero code: 2

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.