All Projects → IrineSistiana → mos-tls-tunnel

IrineSistiana / mos-tls-tunnel

Licence: MIT license
Archived. Check this out https://github.com/IrineSistiana/simple-tls

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mos-tls-tunnel

Tlsfuzzer
SSL and TLS protocol test suite and fuzzer
Stars: ✭ 335 (+1495.24%)
Mutual labels:  tls, tls13
Docker Nginx Http3
Alpine Linux image with Nginx 1.19.4 (mainline) with HTTP/3 (QUIC), TLSv1.3, 0-RTT, brotli, NJS support, and 10 MB size. All built on the bleeding edge for max performance. Built on the edge, for the edge.
Stars: ✭ 820 (+3804.76%)
Mutual labels:  tls, tls13
Illustrated Tls13
The Illustrated TLS 1.3 Connection: Every byte explained
Stars: ✭ 372 (+1671.43%)
Mutual labels:  tls, tls13
ssldump
ssldump - (de-facto repository gathering patches around the cyberspace)
Stars: ✭ 160 (+661.9%)
Mutual labels:  tls, tls13
V2ray Websocket Tls Web Setup Script
V2Ray-WebSocket ws +TLS 1.3 +Web 搭建/管理脚本
Stars: ✭ 155 (+638.1%)
Mutual labels:  tls, tls13
Wolfmqtt
wolfMQTT is a small, fast, portable MQTT client implementation, including support for TLS 1.3.
Stars: ✭ 316 (+1404.76%)
Mutual labels:  tls, tls13
Blinksocks
A framework for building composable proxy protocol stack.
Stars: ✭ 587 (+2695.24%)
Mutual labels:  tls, shadowsocks
gost
GO Simple Tunnel - a simple tunnel written in golang
Stars: ✭ 8,395 (+39876.19%)
Mutual labels:  tls, shadowsocks
Atls
A light TLS implementation used for learning: TLS 1.0 TLS 1.1 TLS 1.2 TLS 1.3 GMSSL 1.1(国密SSL) based on libcrypto.so.
Stars: ✭ 134 (+538.1%)
Mutual labels:  tls, tls13
Tlslite Ng
TLS implementation in pure python, focused on interoperability testing
Stars: ✭ 119 (+466.67%)
Mutual labels:  tls, tls13
wolfssl-py
Python wrapper for wolfSSL embedded SSL/TLS library.
Stars: ✭ 30 (+42.86%)
Mutual labels:  tls, tls13
dheater
D(HE)ater is a proof of concept implementation of the D(HE)at attack (CVE-2002-20001) through which denial-of-service can be performed by enforcing the Diffie-Hellman key exchange.
Stars: ✭ 142 (+576.19%)
Mutual labels:  tls, tls13
Leaf
A lightweight and fast proxy utility tries to include any useful features.
Stars: ✭ 530 (+2423.81%)
Mutual labels:  tls, shadowsocks
Wolfssl
wolfSSL (formerly CyaSSL) is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3!
Stars: ✭ 1,098 (+5128.57%)
Mutual labels:  tls, tls13
Sslyze
Fast and powerful SSL/TLS scanning library.
Stars: ✭ 2,623 (+12390.48%)
Mutual labels:  tls, tls13
idris2-tls
A portable idris2 implementation of TLS
Stars: ✭ 25 (+19.05%)
Mutual labels:  tls, tls13
hyper-proxy
A proxy connector for Hyper-based crates
Stars: ✭ 73 (+247.62%)
Mutual labels:  tls
iot security
《密码技术与物联网安全——mbedtls开发实战》示例代码
Stars: ✭ 111 (+428.57%)
Mutual labels:  tls
k8s-webhook-cert-manager
Generate certificate suitable for use with any Kubernetes Mutating Webhook.
Stars: ✭ 59 (+180.95%)
Mutual labels:  tls
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (+66.67%)
Mutual labels:  tls

mos-tls-tunnel

mos-tls-tunnel is a command line based utility that open a tls tunnel between two addresses and transfers data between them. Also support shadowsocks SIP003 and multi-user server.


Usage

client ---> |mtt-client| ---> |mtt-server| ---> destination

Note: In order for the client to connect to the server normally, the following options must be consistent between the client and the server. In other words, if the server has this option, the client must also have this option, and vice versa.

  • if server enabled wss: wss and wss-path must be consistent.
  • if server NOT enabled wss: wss and mux must be consistent.

mtt-client

-b string
    [Host:Port] Bind address, e.g. '127.0.0.1:1080'
-s string
    [Host:Port] Server address

-wss
    Enable WebSocket Secure protocol
-wss-path string
    WebSocket path (default "/")
-mux
    Enable multiplex
-mux-max-stream int
    The max number of multiplexed streams in one ture TCP connection, 1 - 16 (default 4)
Geek options
-sv
    Skip verify. Client won't verify the server's certificate chain and host name.
-fast-open
    (Linux kernel 4.11+ only) Enable TCP fast open
-n string
    Server name. Use to verify the hostname and to support virtual hosting.

-timeout duration
    The idle timeout for connections (default 5m0s)
-fallback-dns string
    [IP:Port] Use this server instead of system default to resolve host name in -b -r, must be an IP address.
-verbose
    more log

mtt-server

-b string
    [Host:Port] or [Path](if bind-unix) Server bind address, e.g. '127.0.0.1:1080', '/run/mmt-server', '@mmt-server'
-d string
    [Host:Port] Destination address

-wss
    Enable WebSocket Secure protocol
-wss-path string
    WebSocket path (default "/")
-mux
    Enable multiplex

-cert string
    [Path] X509KeyPair cert file
-key string
    [Path] X509KeyPair key file
Geek options
-bind-unix 
    Bind on unix socket instead of TCP socket. 
-fast-open
    (Linux kernel 4.11+ only) Enable TCP fast open
-disable-tls
    disable TLS. An extra TLS proxy is required, such as Nginx SSL Stream Module
-n string
    Server name. Use to generate self signed certificate DNSName

-timeout duration
    The idle timeout for connections (default 5m0s)
-verbose
    more log

mtt-mu-server

See here

Shadowsocks Plugin (SIP003)

mos-tls-tunnel support shadowsocks SIP003. Options keys are the same as Usage defined. You don't have to set client and server address: b,d,s, shadowsocks will set those automatically.

Example Command

Below are example commands with shadowsocks-libev.

Shadowsocks over TLS

ss-server -c config.json --plugin mtt-server --plugin-opts "key=/path/to/your/key;cert=/path/to/your/cert"
ss-local -c config.json --plugin mtt-client --plugin-opts "n=your.server.hostname"

Shadowsocks over WebSocket Secure(wss)

ss-server -c config.json --plugin mtt-server --plugin-opts "wss,key=/path/to/your/key;cert=/path/to/your/cert"
ss-local -c config.json --plugin mtt-client --plugin-opts "wss;n=your.server.hostname"

Recommended Shadowsocks server and client

Android plugin

The Android plugin project is maintained here: mostunnel-android. This is a plugin of shadowsocks-android.

WebSocket Secure

mos-tls-tunnel support WebSocket Secure protocol (wss). WebSocket connections can be proxied by HTTP server such as Apache, as well as most of CDNs that support WebSocket.

wss-path will be the path of HTTP request.

Multiplex (Experimental)

mos-tls-tunnel support connection Multiplex (mux). It significantly reduces handshake latency, at the cost of high throughput.

Client can set mux-max-stream to control the maximum number of data streams in one TCP connection. The value should be between 1 and 16.

if wss is enabled, server can automatically detect whether client enable mux or not. But you can still use the mux to force the server to enable multiplex if auto-detection fails.

Self Signed Certificate

On the server, if both key and cert is empty, a self signed certificate will be used. And the string from n will be certificate's hostname. This self signed certificate CANNOT be verified.

On the client, if server's certificate can't be verified. You can enable sv to skip the verification. Enable this option only if you know what you are doing. Use it with caution.

We recommend that you use a valid certificate all the time. A free and valid certificate can be easily obtained here. Let's Encrypt

mtt-server Multi-user Version (mtt-mu-server)

mtt-mu-server allows multiple users to use the wss mode of mtt-client to transfer data on the same server port (eg: 443). Users are offloaded to the corresponding backend (dst destination) according to the path (wss-path) of their HTTP request.

This can increase the concealment and security of the server. Because we no longer need to expose a large number of ports to different users. And if mtt-mu-server can run on port 443, it will look like a normal HTTPS server.

API is very simple: Use HTTP's POST method to send commands to the Controller to add or delete as many users as you want.

For more, see here.

Build from Source

In general, you need the following build dependencies:

  • golang-go
  • git

You might build mos-tls-tunnel like this:

Example
# get source
go get -d -u github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-client
go get -d -u github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-server
go get -d -u github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-mu-server

# start building
go build -o ./ github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-client
go build -o ./ github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-server
go build -o ./ github.com/IrineSistiana/mos-tls-tunnel/cmd/mtt-mu-server

Open Source Components / Libraries

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].