Coder Social home page Coder Social logo

lunnel's Introduction

中文 | English

Lunnel

lunnel 是一款简单易用的内网NAT穿越、反向代理软件,支持 HTTP, HTTPS, UDP, TCP、Unix socket 协议。

Feature

  1. 隧道连接默认使用 TCP、KCP 自动切换模式,隧道传输协议可以任意替换。
  2. 支持 AES、TLS 加密,客户端与服务器端建立隧道只需一次密钥交换握手,建立连接速度更快。
  3. 自建隧道连接池,保证高并发下的访问通畅。
  4. 单个连接支持多路并发(类似http 2.0),更节省资源。

QuickStart

为 docker daemon 配置 HTTP API 访问

  1. 修改服务端配置:
server_domain: example.com
port: 8080
aes:
  secret_key: password
tls:
  cert: ./example.crt
  key: ./example.key
  1. 在公网启动服务端程序:sudo ./lunnelSer -c ./config.yml
  2. 修改客户端配置并保存:
server_addr: <your_server_ip>:8080
tunnels:
  docker:
    schema: http
    local: unix:///var/run/docker.sock
    host: docker.exmpale.com
aes:
  secret_key: password
enable_compress: true
  1. 在本地启动客户端程序:./lunnelCli -c ./config.yml
  2. 在浏览器中访问 docker.example.com 即可通过 http api 来控制 docker

为 2048 小程序反向代理

  1. 使用上一例中服务端的配置并启动服务端程序:sudo ./lunnelSer -c ./config.yml
  2. 使用 docker 启动 2048 程序,并运行在本地 32768 端口:docker run -d -p 32768:80 daocloud.io/sakeven/2048
  3. 修改客户端配置并保存:
server_addr: <your_server_ip>:8080
tunnels:
  2048:
    schema: http
    local: http://127.0.0.1:32768
    http_host_rewrite: www.2408.com
tls:
  trusted_cert: ./cacert-example.pem
server_name:  example.com
  1. 在本地启动客户端程序:./lunnelCli -c ./config.yml
  2. 通过观察客户端日志,找到外网公开访问地址后在浏览器中访问(因为本例没有为该代理隧道指定 host,所以由服务端分配远程公开访问地址)

Q&A

Q: 在示例配置中客户端使用的是 TLS 加密方式,需要 CA 签发的 SSL 证书,如果没有的话怎么办?
A: 可以使用 OpenSSL 自签名证书,请参考:基于 OpenSSL 自建 CA 和颁发 SSL 证书OpenSSL 生成 SSL 证书
或者您也可以在客户端以及服务端配置文件中指定 aes.secret_key 从而使用 aes 加密。

Q: 启动程序的时候为何报错 found character that cannot start any token
A: YAML 格式的配置文件每一行的开头不允许出现 tab 字符,请将所有的 tab 换成空格。

Config Reference

TODO

  • 持久化客户端获得的远公开访问地址,不再因为暂时失联而重新分配公开访问地址
  • 使用 HTTP API 实时修改客户端的代理隧道支持,不需要重启客户端
  • 优化隧道连接池算法
  • 底层传输协议支持 QUIC
  • 提供 Dashboard 管理界面,开放 HTTP 接口
  • 集成raft一致性协议,服务端可横向伸缩扩展

lunnel's People

Contributors

allenloong avatar cnlon avatar

Stargazers

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

Watchers

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

lunnel's Issues

关于客户端tcp映射的问题?

2048_tcp:
schema: tcp
#当协议是tcp或udp时可以指定外网访问端口,如果端口已存在,则会报错
port: 33333
local: http://127.0.0.1:32768

1、port:33333 这一行指的是远程VPS上面要映射的tcp端口吗?
2、local:http://127.0.0.1:32768 这行是指本地要映射的tcp端口吗???为什么前面还有http://,看不懂这个规则啊

33333_tcp:
schema: tcp
local_ip =127.0.0.1
local_port = 32768
remote_port = 33333
要是能改成这种形式的就一目了然了

建议作者看下这个ini配置:
https://github.com/fatedier/frp
https://github.com/fatedier/frp/blob/master/conf/frps_full.ini
https://github.com/fatedier/frp/blob/master/conf/frpc_full.ini
命令非常的易懂,清晰明了

Getting more done in GitHub with ZenHub

Hola! @longXboy has created a ZenHub account for the longXboy organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @longXboy.

ZenHub Board

没有windows_386的版本吗?

在release里面没有找到windows x32的版本。我的VPS服务器是windows server 2003 x32位系统。麻烦作者编译生成一下。对go一点不懂啊。

重构smux和conrol

抽象出contorl的conn部分,将control的管理conn也放入smux中统一管理

有关不能启用https的问题。

你好,感谢你的软件;经过大量高并发测试,发现你的lunnel比frp要稳定,打算部署在生产上。
但是发现https开启不了。
在阿里云上部署,如下是server端配置。在不开启client端时就可以在浏览器里面访问http://aaa:86,只是报通道错误而已,但不能访问https://aaa:85,观察端口已经处于监听状态。防火墙已关闭,端口已打开。
先谢了!
server_domain: aaa
ip: xxx
port: 87
http_port: 86
https_port: 85
manage_port: 8081
aes:
secret_key: yyyy
tls:
cert: e:\ecnu-cert\aaa.cer
key: e:\ecnu-cert\aaa.key
debug: true
log_file: ./client.log

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.