kcpraw_test

module
v0.0.0-...-0459e71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: MIT

README

Name

kcpraw - an useful fork of kcptun

Synopsis

$ kcpraw_client_darwin_amd64 -l 127.0.0.1:1080 -r vps:80 --key secret --mode fast3 --mtu 1200 --ds 0 --ps 0 --nocomp --host www.zhihu.com   
# kcpraw_server_linux_amd64 -l vps:80 -t :10086 --key secret --mtu 1200 --mode fast2 --ds 0 --ps 0 --nocomp

Features

  • turn udp traffic to tcp traffic
  • http obfuscating
  • easy to install & build & use
  • provide socks5/socks4/socks4a/http & shadowsocks server at kcpraw/server
  • support socks5 udp-associate
  • provide additional tcp/udp tunnels
  • aggregate multiple underlying connections to one kcp connection

Installation

It is highly recommended to use kcpraw releases.

Note for Windows Users
kcpraw is dependent on winpcap.You should download and install it from winpcap first.

Note for Linux Users
kcpraw uses raw-socket to receive and send tcp packets. root permission is required.

Note for Macos Users
kcpraw requires read permission for /dev/bpfx. so don't run kcpraw as nobody.

Build

Alternatively, you can manually compiled it from source:
1.Download and install Go from https://golang.org/dl/ if you don't have go yet.
2.Run go get or build.sh

$ go get -u -v github.com/zhengying/kcpraw/kcpraw/client
$ go get -u -v github.com/zhengying/kcpraw/kcpraw/server  

# or 
$ go get github.com/zhengying/kcpraw/kcpraw  
$ cd $GOPATH/src/github.com/zhengying/kcpraw/kcpraw  
$ ./build.sh  

Note for Windows Users

If you're trying to compile 64-bit kcpraw(or google/gopacket) on 64-bit Windows, you might have to do the crazy hijinks detailed at compile gopacket on windows

Usage

$ ./client -h
NAME:
   kcpraw - client(with SMUX)

USAGE:
   client [global options] command [command options] [arguments...]

VERSION:
   SELFBUILD

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --localaddr value, -l value      local listen address (default: ":12948")
   --remoteaddr value, -r value     kcp server address (default: "vps:29900")
   --key value                      pre-shared secret between client and server (default: "it's a secrect") [$KCPTUN_KEY]
   --crypt value                    aes, aes-128, aes-192, chacha20, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none (default: "aes")
   --mode value                     profiles: fast3, fast2, fast, normal, manual (default: "fast")
   --conn value                     set num of UDP connections to server (default: 1)
   --autoexpire value               set auto expiration time(in seconds) for a single UDP connection, 0 to disable (default: 0)
   --mtu value                      set maximum transmission unit for UDP packets (default: 1350)
   --sndwnd value                   set send window size(num of packets) (default: 128)
   --rcvwnd value                   set receive window size(num of packets) (default: 512)
   --datashard value, --ds value    set reed-solomon erasure coding - datashard (default: 10)
   --parityshard value, --ps value  set reed-solomon erasure coding - parityshard (default: 3)
   --dscp value                     set dscp(6bit) (default: 0)
   --nocomp                         disable compression
   --snmplog value                  collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log
   --snmpperiod value               snmp collect period, in seconds (default: 60)
   --log value                      specify a log file to output, default goes to stderr
   -c value                         config from json file, which will override the command from shell
   --host value                     hostname for obfuscating (Experimental)
   --nohttp                         don't send http request after tcp 3-way handshake
   --scavengettl value              set how long an expired connection can live(in sec), -1 to disable (default: 600)
   --mulconn value                  use multiple underlying conns for one kcp connection, default is 0 (default: 0)
   --udp                            enable udp mode
   --pprof value                    set the listen address for pprof
   --nodummy                        don't use dummy socket
   --proxylist value                set the path of proxy list
   --chnroute value                 set the path of china route
   --proxy                          enable default proxy(socks4/socks4a/socks5/http)
   --udprelay                       enable socks5 udp relay
   --tunnels value                  provide additional tcp/udp tunnels, eg: udp,:10000,8.8.8.8:53;tcp,:10080,www.google.com:80
   --help, -h                       show help
   --version, -v                    print the version

$ ./server -h
NAME:
   kcpraw - server(with SMUX)

USAGE:
   server [global options] command [command options] [arguments...]

VERSION:
   SELFBUILD

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --listen value, -l value         kcp server listen address (default: ":29900")
   --target value, -t value         target server address (default: "127.0.0.1:12948")
   --key value                      pre-shared secret between client and server (default: "it's a secrect") [$KCPTUN_KEY]
   --crypt value                    aes, aes-128, aes-192, chacha20, salsa20, blowfish, twofish, cast5, 3des, tea, xtea, xor, sm4, none (default: "aes")
   --mode value                     profiles: fast3, fast2, fast, normal, manual (default: "fast")
   --mtu value                      set maximum transmission unit for UDP packets (default: 1350)
   --sndwnd value                   set send window size(num of packets) (default: 1024)
   --rcvwnd value                   set receive window size(num of packets) (default: 1024)
   --datashard value, --ds value    set reed-solomon erasure coding - datashard (default: 10)
   --parityshard value, --ps value  set reed-solomon erasure coding - parityshard (default: 3)
   --dscp value                     set dscp(6bit) (default: 0)
   --nocomp                         disable compression
   --usemul                         use multiple underlying conns for one kcp connection
   --snmplog value                  collect snmp to file, aware of timeformat in golang, like: ./snmp-20060102.log
   --snmpperiod value               snmp collect period, in seconds (default: 60)
   --log value                      specify a log file to output, default goes to stderr
   -c value                         config from json file, which will override the command from shell
   --udp                            enable udp mode
   --pprof value                    set the listen address for pprof
   --proxy                          enable default proxy(socks4/socks4a/socks5/http)
   --ssproxy                        enable shadowsocks proxy
   --ssmethod value                 set the method of shadowsocks proxy (default: "multi")
   --sskey value                    set the password of shadowsocks proxy
   --help, -h                       show help
   --version, -v                    print the version

Report Bugs

You're very welcom to report issues on GitHub:

https://github.com/zhengying/kcpraw/kcpraw/issues

Authors

  • xtaci
  • ccsexyz

Directories

Path Synopsis
Package gopacket provides packet decoding for the Go language.
Package gopacket provides packet decoding for the Go language.
afpacket
Package afpacket provides Go bindings for MMap'd AF_PACKET socket reading.
Package afpacket provides Go bindings for MMap'd AF_PACKET socket reading.
bytediff
Package bytediff provides a simple diff utility for looking at differences in byte slices.
Package bytediff provides a simple diff utility for looking at differences in byte slices.
dumpcommand
Package dumpcommand implements a run function for pfdump and pcapdump with many similar flags/features to tcpdump.
Package dumpcommand implements a run function for pfdump and pcapdump with many similar flags/features to tcpdump.
examples/arpscan
arpscan implements ARP scanning of all interfaces' local networks using gopacket and its subpackages.
arpscan implements ARP scanning of all interfaces' local networks using gopacket and its subpackages.
examples/bidirectional
This binary provides an example of connecting up bidirectional streams from the unidirectional streams provided by gopacket/tcpassembly.
This binary provides an example of connecting up bidirectional streams from the unidirectional streams provided by gopacket/tcpassembly.
examples/bytediff
This binary shows how to display byte differences to users via the bytediff library.
This binary shows how to display byte differences to users via the bytediff library.
examples/httpassembly
This binary provides sample code for using the gopacket TCP assembler and TCP stream reader.
This binary provides sample code for using the gopacket TCP assembler and TCP stream reader.
examples/pcapdump
The pcapdump binary implements a tcpdump-like command line tool with gopacket using pcap as a backend data collection mechanism.
The pcapdump binary implements a tcpdump-like command line tool with gopacket using pcap as a backend data collection mechanism.
examples/pcaplay
The pcaplay binary load an offline capture (pcap file) and replay it on the select interface, with an emphasis on packet timing
The pcaplay binary load an offline capture (pcap file) and replay it on the select interface, with an emphasis on packet timing
examples/pfdump
The pfdump binary implements a tcpdump-like command line tool with gopacket using pfring as a backend data collection mechanism.
The pfdump binary implements a tcpdump-like command line tool with gopacket using pfring as a backend data collection mechanism.
examples/reassemblydump
The pcapdump binary implements a tcpdump-like command line tool with gopacket using pcap as a backend data collection mechanism.
The pcapdump binary implements a tcpdump-like command line tool with gopacket using pcap as a backend data collection mechanism.
examples/statsassembly
This binary provides sample code for using the gopacket TCP assembler raw, without the help of the tcpreader library.
This binary provides sample code for using the gopacket TCP assembler raw, without the help of the tcpreader library.
examples/synscan
synscan implements a TCP syn scanner on top of pcap.
synscan implements a TCP syn scanner on top of pcap.
examples/util
Package util provides shared utilities for all gopacket examples.
Package util provides shared utilities for all gopacket examples.
ip4defrag
Package ip4defrag implements a IPv4 defragmenter
Package ip4defrag implements a IPv4 defragmenter
layers
Package layers provides decoding layers for many common protocols.
Package layers provides decoding layers for many common protocols.
macs
Package macs provides an in-memory mapping of all valid Ethernet MAC address prefixes to their associated organization.
Package macs provides an in-memory mapping of all valid Ethernet MAC address prefixes to their associated organization.
pcap
Package pcap allows users of gopacket to read packets off the wire or from pcap files.
Package pcap allows users of gopacket to read packets off the wire or from pcap files.
pcap/gopacket_benchmark
This benchmark reads in file <tempdir>/gopacket_benchmark.pcap and measures the time it takes to decode all packets from that file.
This benchmark reads in file <tempdir>/gopacket_benchmark.pcap and measures the time it takes to decode all packets from that file.
pcapgo
Package pcapgo provides some native PCAP support, not requiring C libpcap to be installed.
Package pcapgo provides some native PCAP support, not requiring C libpcap to be installed.
pfring
Package pfring wraps the PF_RING C library for Go.
Package pfring wraps the PF_RING C library for Go.
reassembly
Package reassembly provides TCP stream re-assembly.
Package reassembly provides TCP stream re-assembly.
routing
Package routing provides a very basic but mostly functional implementation of a routing table for IPv4/IPv6 addresses.
Package routing provides a very basic but mostly functional implementation of a routing table for IPv4/IPv6 addresses.
tcpassembly
Package tcpassembly provides TCP stream re-assembly.
Package tcpassembly provides TCP stream re-assembly.
tcpassembly/tcpreader
Package tcpreader provides an implementation for tcpassembly.Stream which presents the caller with an io.Reader for easy processing.
Package tcpreader provides an implementation for tcpassembly.Stream which presents the caller with an io.Reader for easy processing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL