Skip to content

starius/onion2web

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

onion2web

Access .onion sites without Tor Browser

Homepage.

Dependency: lua-resty-socks5.

Paper (in Russian).

Installation

$ sudo luarocks install onion2web

Reference

This module contains the following functions:

  • onion2web.handle_onion2web(onion_replacement, torhost='127.0.0.1', torport=9050, confirmation=true) - accept request to onion2web site. onion_replacement is part of gateway domain name, which replaces .onion (e.g., .onion.gq). torhost and torport are Tor address and SocksPort. If confirmation is true (the default), then the confirmation page is shown instead of contents of a hidden service until a user accepts the terms.

How to use this module to forward requests from xxx.onion.gq to xxx.onion:

server {
    listen 80;
    server_name *.onion.gq;
    location / {
        default_type text/html;
        content_by_lua '
            require("onion2web").handle_onion2web(".onion.gq");
        ';
    }
}

To blacklist some .onion sites:

server {
        listen   80;
        server_name
.badonion12345678.onion.gq
.anotherbadonion1.onion.gq
;
        return 403;
}

About

Access .onion sites without Tor Browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published