Commit Graph
1268 Commits
Author SHA1 Message Date
zonyitoo c1b6bb5c50 compatible with MIPS and PowerPC for non-supported AtomicU64 2020-12-31 22:28:26 +08:00
zonyitoo 7467d51f99 update toolchain nightly-2020-12-30 2020-12-31 21:40:43 +08:00
zonyitoo 04791a5d85 disable non-commonly used CPU features 2020-12-31 21:09:02 +08:00
zonyitoo 9abf3847c1 check UDP packet's data length before decrypt_packet
fixes shadowsocks/crypto2#8
2020-12-31 19:58:22 +08:00
zonyitoo 474e57a331 unified local UDP association implementation
NOTE: Every time when sending packets back to local listener will
require an allocation of Box<Pin<Future>> because GAT is not stablized
yet.
2020-12-31 13:07:34 +08:00
zonyitoo e048bc2f34 trust-dns-resolver requires explicit enables feature dns-over-https-rustls
fix #367
2020-12-30 15:36:09 +08:00
zonyitoo 2a92ab8324 ci tests with rust-toolchain file 2020-12-30 15:09:04 +08:00
zonyitoo 75c28313ea disable https by default, let users to choose which TLS library to use 2020-12-30 10:09:34 +08:00
zonyitoo 38b5f831c7 enable h2 for native-tls https 2020-12-30 01:46:40 +00:00
zonyitoo 2bcc40c4f7 upgrade to trust-dns-resolver v0.20 release 2020-12-30 09:16:20 +08:00
zonyitoo ea03dc2122 fix typo of inbound-recv-buffer-size outbound-recv-buffer-size, ref #352 2020-12-28 19:12:42 +08:00
zonyitoo 91d25d3cc0 ignore mode in local-dns local resolver
ref shadowsocks/shadowsocks-android#2635
2020-12-28 13:23:00 +08:00
ty 303f96c61f Upgrade to tokio 1.0 (#358)
* upgrade to tokio v1.0

- removed tokio::prelude
- upgrade hyper to v0.14, tokio-rustls to v0.22

still working on migrating trust-dns-* and tokio-native-tls

ref #354

* tokio v1.0 removed with_poll

fix #355, ref #354

* removed CTRL-BREAK signal handler

ref #354

* fixes compliation error, add missing return

fixes #355

* allow setting SO_SNDBUF and SO_RCVBUF for sockets

ref #352

* completely removed unix socket based DNS resolving

ref shadowsocks/shadowsocks-android#2622

* fix build issue on Windows

* fixed uds poll_write loop, fixed udp outbound loopback check

ref #355

* disable default trust-dns resolver for andorid, macos, ios

This commit also:

- Optimized resolve() logging with elapsed time
- updated tokio-native-tls

* local-dns removed from default features

* fix rustc version with rust-toolchain

* Bump bytes from 0.6.0 to 1.0.0

* add dependabot badge

* indirectly depend on trust_dns_proto via trust_dns_resolver

* auto reconnect if udp sendto failed

* recreate proxied socket if recv() returns failure

* increase score precision to 0.0001

* example of log4rs configuration

* PingBalancer instance shouldn't kill probing task when dropping

- Probing task should be controlled by the internal shared state

* switch to trust-dns main for latest tokio 1.0 support
2020-12-28 10:10:19 +08:00
dependabot-preview[bot] 4d32f6d90b Bump rand from 0.7.3 to 0.8.0 (#363) 2020-12-26 16:50:01 +00:00
dependabot-preview[bot] 12b96eaa94 Bump log4rs from 0.13.0 to 1.0.0
Bumps [log4rs](https://github.com/estk/log4rs) from 0.13.0 to 1.0.0.
- [Release notes](https://github.com/estk/log4rs/releases)
- [Changelog](https://github.com/estk/log4rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/estk/log4rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-27 00:18:19 +08:00
zonyitoo 3a1054acc5 queries UDP & TCP simutaneously 2020-12-23 20:45:01 +08:00
zonyitoo 1af4206d65 returns error if dns resolved empty 2020-12-23 01:45:00 +08:00
zonyitoo 1288c2ed7c ignore bind transparent ip error and continue receiving 2020-12-22 23:53:06 +08:00
zonyitoo 4fdc41dbbf removed confusing redir tcp log 2020-12-22 22:51:10 +08:00
zonyitoo 80bbe04559 hide the first balancer check info log 2020-12-22 22:37:14 +08:00
zonyitoo 3e27fed614 fixed future and Arc circlar reference 2020-12-22 22:31:19 +08:00
zonyitoo 24e203f5f9 use sleep instead of interval 2020-12-22 15:38:14 +08:00
zonyitoo 9210ee63ac local server starts after plugins are started, and balancer have choosen the best server 2020-12-22 15:11:49 +08:00
zonyitoo 4065ba3d38 fixed bug, calculate UDP server score 2020-12-22 14:35:41 +08:00
zonyitoo 49961a032b increase udp pending packet slots to 1024 2020-12-22 12:44:07 +08:00
zonyitoo 3d8c4cb641 lower log level to trace 2020-12-22 09:17:20 +08:00
zonyitoo 156c588dbc redir tcp should connect remote based on acl 2020-12-22 01:12:29 +08:00
zonyitoo 5eae086313 skip unused rdata section 2020-12-22 01:01:18 +08:00
zonyitoo fc17623c9e add useful logs about association drops 2020-12-22 00:28:10 +08:00
zonyitoo 906e0ed3e2 renamed recv_from_with_destination to recv_dest_from 2020-12-21 22:26:03 +08:00
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