|John-Mark Gurney 5ee76cbbef||3 months ago|
|ntunnel||3 months ago|
|.gitignore||11 months ago|
|LICENSE.txt||11 months ago|
|Makefile||11 months ago|
|NOTES.md||3 months ago|
|README.md||6 months ago|
|makemessagelengths.py||11 months ago|
|requirements.txt||11 months ago|
|setup.py||9 months ago|
|twistednoise.py||11 months ago|
The ntunnel program is designed to tunnel Unix domain sockets over TCP, using the Noise Protocol. The goal is to be secure and simple to use and setup. Due to the flexibility, it can forward any standard stream socket to another stream socket, including TCP sockets.
Note: If you have installed the package, there is also the program
ntunnel that can be used instead of
python -m ntunnel.
Generate the keys:
python -m ntunnel genkey serverkey python -m ntunnel genkey clientkey
Create the target for the pass through:
nc -lU finalsock
Start the server and client:
python -m ntunnel server serverkey --clientkey clientkey.pub unix:$(pwd)/servsock unix:$(pwd)/finalsock python -m ntunnel client clientkey serverkey.pub unix:$(pwd)/clientsock unix:$(pwd)/servsock
Attach to the client:
nc -U clientsock
Now when you type text into either of the nc windows, you should see the same text come out the other side.
Currently ntunnel requires Python 3.7 or later. If the default virtualenv is not 3.7 or later, you can set the VIRTUALENV variable to specify which one to use, such as:
make env VIRTUALENV=virtualenv-3.7
If you want to use an alternate version of python, you can specify VIRTUALENVARGS, such as:
make env VIRTUALENV=virtualenv-3.7 VIRTUALENVARGS="-p $(which pypy3)"
Once you have the environment setup, you can source the development environment:
and then run the tests:
If you have the program entr (used for watching files, and running a command) installed, you can use the command:
to run the tests, and whenever ntunnel/init.py gets modified, the tests will automatically run. This is useful for running in another window (such a tmux), and being able to quickly see the results of your tests.
Note that I have not been able to test this w/ pypy3, as when compiling the cryptography libraries, it would pick the wrong ones, despite setting CFLAGS and LDFLAGS.