Giter Site home page Giter Site logo

bing0 / tun2socks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhuhaow/tun2socks

0.0 2.0 0.0 737 KB

A tun2socks framework with Swift wrapper

Home Page: https://zhuhaow.github.io/tun2socks/

License: BSD 3-Clause "New" or "Revised" License

C 98.22% Objective-C 0.92% C++ 0.20% Swift 0.66%

tun2socks's Introduction

tun2socks

Build Status GitHub release Carthage compatible GitHub license

tun2socks is designed to work with the NetworkExtension framework. It is based on the latest stable lwip with minimal modification.

Feature

The whole stack is based on GCD which is efficient and fast.

Only TCP protocol is supported.

All other protocols (UDP, ICMP, IGMP, ...) will not be supported since they are stateless or can not be supported in NetworkExtension.

Usage

The overall structure of tun2socks:

╔═══════════════════════╗                                                       
║sourceAddress: X.X.X.X ║                                                       
║    sourcePort: XX     ║                    writeData(_:)                      
╚═══════════════════════╝                          │                            
                                                   │            ┌──────────────┐
┌─────────────┐  ┌───────┐  ┌────────────┐  ┌──────▼──────┐     │TSTCPSocketDel│
│    Local    ◀──▶  TUN  ◀──▶ TSIPStack  ◀──▶ TSTCPSocket ├─────▶egate.didReadD│
└─────────────┘  └───────┘  └────────────┘  └─────────────┘     │    ata()     │
                                                                └──────────────┘

Fully documented API reference can be found here.

Carthage is recommended to integrate tun2socks by adding

github "zhuhaow/tun2socks"

to the Cartfile.

Another alternative may be NEKit which wraps around tun2socks and provides many features to build a proxy app.

IPv6 support

As of now, IPv6 is not supported since lwip 1.4 does not support dual stack. IPv6 will be supported in the next major version of lwip.

tun2socks's People

Contributors

zhuhaow avatar

Watchers

James Cloos avatar  avatar

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.