Code Monkey home page Code Monkey logo

ztun's Introduction

Feature

Dual Stack
Async DNS
Non-blocking IO
Zero Copy

Build

git clone https://github.com/zephyrchien/ztun
cd ztun
mkdir build && cd build
cmake ..
make

Usage

ztun -l <local> -r <remote> # from args
ztun -c <conf> # from config file

Config

# comment, starting with #

# set log level and output path
# level = none|warn|info|debug, default is info
# file = filename, default is stderr
log_level = info
log_file = ztun.log

# set the precision of timer and operation timeout
# value: 1~2147483647(INT_MAX) ms
# timer_intv = xxx, default is 500
# connect_timeout = xxx, default is 2000
# resolve_intv = xxx, default is 60000
# resolve_timeout = xxx, default is 2000
timer_intv = 500
connect_timeout = 2000
resolve_intv = 60000
resolve_timeout = 2000

# set preallocated memory
# one connection requires 2 pipe + 1 connector + 2 readwriter + at least 1 timer
# object| cost * ratio(hard coded):
# pipe 16b * 2,
# timer 40b * 2,
# connector 88b * 1,
# readwriter 112b * 2,
# total 424b
prealloc = 30 # 60 pipe + 60 timer + 30 connector + 60 readwriter

# group1
local = 127.0.0.1:5000
remote = 1.1.1.1:443

# group2 (use ipv6)
local = ::1:10000
remote = 2.2.2.2:8080

# group3 (use domain name)
local = :15000
remote = www.google.com:80

# and more...

ztun's People

Contributors

zephyrchien avatar

Stargazers

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

Watchers

 avatar  avatar

ztun's Issues

不知道什么时候突然就挂了

terminate called after throwing an instance of 'std::bad_function_call'
  what():  bad_function_call
Aborted

重新运行一段时间后

Segmentation fault

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.