Commit Graph
1238 Commits
Author SHA1 Message Date
zonyitoo 89e9b1400a active cleanup of expired udp associations, fixed #351 2020-12-21 22:21:26 +08:00
zonyitoo faed7ed3e2 avoid async_trait on recv_from_with_destination call 2020-12-21 22:00:49 +08:00
zonyitoo 34fadeecd2 fixed bsd udp redir build 2020-12-21 10:30:01 +08:00
zonyitoo bc33723107 compile with opt-level=z for mips target
- ref #342
2020-12-20 19:16:22 +08:00
ty 07583f3cc8 Refactored and separate library into crates (#345)
* Refactored and separate library into crates

- shadowsocks: the core feature of shadowsocks
- shadowsocks-service: library for building shadowsocks services
    - dns, http, redir, socks, tunnel
    - load balancer
- shadowsocks-rust: release binaries

fix #347

* unified DnsResolver implementation

* unified local service common parameters into ServiceContext

- ServiceContext is common parameters shared between all local
implementations
- Completely removed https local support

* add #292 reply attack protection

* migrated redir local server

* support customizing outbound socket bind address

* manager outbound socket should accepts connect_opts

* republic local implementations

* socks5 udp server should always listen to client address

* socks4 controlled by local-socks4 feature

* socks4 also obey mode configuration

* socks server tcp cannot be disable. add support of udp-bind-addr parameter

* add udp-bind-addr for customizing udp-relay bind-addr

* local-dns infra, support customizing resolver

* fully implements DNS relay server

* support binding to specific interface on Linux-like platform

* tcp cannot be disabled in socks

* enable local-flow-stat

* fixed windows build

* fixed android specific warnings and compile errors

* allow udp_only mode in socks5

* dns relay listens to both TCP and UDP, mode controls outbound upstreams

* dns relay retries twice if request failed

* doc

* fix DnsClient typo

* fix stream EncryptWriter bug

* allow disable logging output

updated dependencies

* add readme

* refine doc

* remove depending on trust-dns-client

* socks4/4a client

* allow socks5 udp_only mode, fixes compile warning

* create standalone socks5 UDP relay server

- socks5 UDP association full cone (NAT2)

* server udp relay supports full cone (NAT2)

* acl moved to crate root

* redir udp relay support full cone (NAT2)

* standard socks5 udp test must use tcp_and_udp mode

* set server context fields with pub APIs

* udp_max_associations and udp_timeout default value set in Config

* local dns resolver retry with fixed attempts

* max_udp_association keeps unlimited by default

* fixed logging binary name

* pops first exited future result for local and server

* update reverse target index cache

* fix ProxyClientStreamWriteHalf that allows sending empty buffers

ref #232

* remove unused import when socks4 is disabled

* make balancer become a globally shared object

* print plugin exit status

* control local, server, manager services in features
2020-12-20 19:06:21 +08:00
ty a7c9f75d07 Revert "minimize target file size"
This reverts commit d0fc26317d.
2020-12-15 18:30:41 +08:00
kimw d0fc26317d minimize target file size 2020-12-11 20:02:54 +08:00
zonyitoo b0aeb128ab Removed duplicated shadowsocks Logger
- fix #337
2020-12-02 12:53:38 +08:00
zonyitoo 6880c5892c Renamed library back to shadowsocks
- ref #326
- Binary crate will keep shadowsocks-rust's name
2020-12-01 09:09:46 +08:00
zonyitoo 5451714b79 Compatible with local_address missing in configuration
ref #332
2020-11-29 15:14:05 +08:00
zonyitoo 22c0180232 Enables shadowsocks-core logging by default 2020-11-29 00:45:32 +08:00
zonyitoo dbaafdd57f users other actions to install nightly 2020-11-29 00:31:00 +08:00
zonyitoo 4a4576bcf5 Split library and binaries into separated crates
- shadowsocks-core is a library contains all necessary functions for
running shadowsocks

- shadowsocks is a binary crate that ships end-user products

ref #326
2020-11-29 00:12:16 +08:00
zonyitoo 89722523a6 Plugins::join_all should exit if one of the plugins is exited
- Make clippy happy
- Upgrade tokio-rustls to 0.21 and other related crates
2020-11-28 02:32:52 +08:00
zonyitoo 2bbc151ff8 Revert AEAD direct buffer decryption
- DecryptedReader provides AsyncRead interface, which means that it
obeys AsyncRead::poll_read calling convention: fills buffer only when
read have been succeeded

- Benchmark doesn't show any speed differences in both download and upload
2020-11-27 20:32:11 +08:00
zonyitoo 5d42ac9371 Update Cargo.lock for trust-dns's commit hash
fix #325
2020-11-26 01:34:27 +08:00
zonyitoo 3184c9c02b Upgrade json5 to v0.3 for compatible with non-BMP unicode 2020-11-24 20:55:41 +08:00
zonyitoo 0cd21827b2 SIP008 configuration format support
- "plugin" could be empty, which implies no plugin
- ServerConfig read and stores "id" and "remarks", only for ser
2020-11-24 09:29:56 +08:00
zonyitoo 81d8b338ad Remove unnecessary customized Dockerfile, RUSTFLAGS is controlled by .cargo/config.toml 2020-11-23 23:36:39 +08:00
zonyitoo 8bd54052ac Config check_integrity extends to DnsLocal, TunnelLocal and HttpsLocal 2020-11-23 23:16:42 +08:00
zonyitoo fee940af88 Customized s2p and p2s copy function 2020-11-23 13:01:48 +08:00
zonyitoo e6718a0510 Ensure ReadBuf is initialized before poll_read 2020-11-23 00:24:05 +08:00
zonyitoo aa6cd4ce48 --local-dns-addr is checked after Android's VPN mode's default address
fix #323
2020-11-22 23:24:31 +08:00
zonyitoo d03e475bcc AEAD DecryptedReader reads directly to ReadBuf if possible
- Avoid unnecessary buffer allocation
2020-11-22 23:06:30 +08:00
zonyitoo bd3d8e5c5e Decrypt reader optimized memory consumption
- Removed data buffer, uses only one buffer for all steps
- Stream reader reads data directly to ReadBuf
2020-11-22 15:17:46 +08:00
zonyitoo 71b98f74d4 Skip setting TCP_NODELAY for bypass calls 2020-11-22 01:18:18 +08:00
zonyitoo c5586a1335 Temporary skip trust-dns https build failure 2020-11-21 23:12:33 +08:00
zonyitoo 741e019da6 Remove deps to mio v0.6 and update all dependencies
fix #321
2020-11-21 22:54:53 +08:00
zonyitoo a807cd307b crypto2 requires unstable simd and asm featurs, we have to build with nightly 2020-11-21 22:18:50 +08:00
zonyitoo 536a2d5799 Build on action with mostly features enabled 2020-11-21 22:03:00 +08:00
zonyitoo e9366e1236 strum is still required for RedirType 2020-11-21 14:07:16 +08:00
zonyitoo 52e16a1f5b Add table and tick Rust crypto TODO 2020-11-21 13:59:35 +08:00
zonyitoo 050512d20d Remove target-cpu=native in default build profile 2020-11-21 13:49:46 +08:00
zonyitoo 855fae6220 Indirect dependent to shadowsocks_crypto, reformatted 2020-11-21 13:38:02 +08:00
zonyitoo d11a162893 Republic shadowsocks_crypto as crypto mod, set available_ciphers 2020-11-21 13:18:39 +08:00
zonyitoo eef5fa2096 Updated hyper upgrade API 2020-11-21 12:08:01 +08:00
luozijun c550913247 Add shadowsocks-crypto 2020-11-21 10:42:56 +08:00
zonyitoo 1758313447 "dns" key is only work for trust-dns feature 2020-11-15 21:16:24 +08:00
zonyitoo 5e428b84de DNS UDP listener sleep 1s if error occurs 2020-11-15 17:01:22 +08:00
zonyitoo b0c35eacf2 Fixed remote query log 2020-11-15 16:57:16 +08:00
zonyitoo 174e50e18e UDP associations sending response directly to socket instead of channel 2020-11-15 15:55:58 +08:00
zonyitoo 5bf36c9ef9 UDP related servers get compatible with recv errors (mostly fd exhausted)
- DNS relay server parse request after tokio::spawn
2020-11-15 14:23:21 +08:00
zonyitoo 782da57064 DNS debug log shouldn't print LOCAL and REMOTE everytime 2020-11-15 14:23:21 +08:00
zonyitoo 7572430e14 Send DNS queries sequentially, UDP then TCP 2020-11-15 14:23:21 +08:00
zonyitoo fd952cac37 fix #318, impl From<&str> for LocalDnsAddr 2020-11-15 14:23:21 +08:00
zonyitoo d1d8f72129 Fixed bug, ring AEAD cipher check output.len() shouldn't use equal 2020-11-15 14:23:21 +08:00
zonyitoo b085122193 fix #318 2020-11-15 14:23:21 +08:00
zonyitoo b78d1f56bf Optimized DNS debug log 2020-11-15 14:23:21 +08:00
zonyitoo 2d533e0592 ProxyUpstream sending queries with both TCP & UDP if possible 2020-11-15 14:23:21 +08:00
zonyitoo cf094ca59b Add back local-dns-relay feature for backward compat 2020-11-15 14:23:21 +08:00