Commit Graph
205 Commits
Author SHA1 Message Date
zonyitoo 63be38deca updated tokio 2021-02-07 09:33:17 +08:00
zonyitoo 0b9ad113ad updated dependencies 2021-02-06 00:04:03 +08:00
zonyitoo 26432b7ae5 update dependencies 2021-02-04 09:11:09 +08:00
dependabot-preview[bot] 6a65aae5b8 Bump notify from 5.0.0-pre.4 to 5.0.0-pre.5
Bumps [notify](https://github.com/notify-rs/notify) from 5.0.0-pre.4 to 5.0.0-pre.5.
- [Release notes](https://github.com/notify-rs/notify/releases)
- [Changelog](https://github.com/notify-rs/notify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/notify-rs/notify/compare/v5.0.0-pre.4...v5.0.0-pre.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-02 09:40:11 +08:00
dependabot-preview[bot] 1e2f68ab91 Bump tokio from 1.1.0 to 1.1.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.1.0...tokio-1.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-02 08:44:54 +08:00
dependabot-preview[bot] 4bb1792979 Bump libc from 0.2.83 to 0.2.84
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.83 to 0.2.84.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.83...0.2.84)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-02 08:44:43 +08:00
zonyitoo 3e771f717e renamed disable to disabled
ref https://github.com/shadowsocks/shadowsocks-rust/discussions/402
2021-01-28 15:11:00 +08:00
dependabot-preview[bot] 05aca6974c Bump tower from 0.4.3 to 0.4.4
Bumps [tower](https://github.com/tower-rs/tower) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-0.4.3...tower-0.4.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 17:07:03 +08:00
dependabot-preview[bot] dfa794b77b Bump lru_time_cache from 0.11.3 to 0.11.5
Bumps [lru_time_cache](https://github.com/maidsafe/lru_time_cache) from 0.11.3 to 0.11.5.
- [Release notes](https://github.com/maidsafe/lru_time_cache/releases)
- [Changelog](https://github.com/maidsafe/lru_time_cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/maidsafe/lru_time_cache/compare/v0.11.3...v0.11.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 16:42:02 +08:00
dependabot-preview[bot] d73c29d214 Bump futures from 0.3.9 to 0.3.12
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.9 to 0.3.12.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.9...0.3.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 16:41:51 +08:00
dependabot-preview[bot] 7eca69cba5 Bump serde from 1.0.118 to 1.0.122
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.118 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.118...v1.0.122)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 16:41:39 +08:00
dependabot-preview[bot] 97bd5ae24c Bump tokio from 1.0.2 to 1.1.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.0.2...tokio-1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 16:41:26 +08:00
zonyitoo 3094ec62bb Linux auto-reload /etc/resolv.conf when using trust-dns
- temporary bypassed bluejekyll/trust-dns#1132
2021-01-19 16:21:51 +08:00
dependabot-preview[bot]andty e8732dd37f Bump rand from 0.8.1 to 0.8.2 (#390)
Bumps [rand](https://github.com/rust-random/rand) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.1...0.8.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ty <zonyitoo@users.noreply.github.com>
2021-01-18 17:50:12 +08:00
dependabot-preview[bot]andty 504fe3b000 Bump tower from 0.4.2 to 0.4.3 (#389)
Bumps [tower](https://github.com/tower-rs/tower) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/commits/tower-0.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ty <zonyitoo@users.noreply.github.com>
2021-01-18 17:28:23 +08:00
dependabot-preview[bot]andty 3a1c56a84b Bump bytes from 1.0.0 to 1.0.1 (#388)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.0.0...v1.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ty <zonyitoo@users.noreply.github.com>
2021-01-18 17:27:46 +08:00
dependabot-preview[bot]andty 9b6ecb3cf4 Bump spin from 0.7.0 to 0.7.1 (#387)
Bumps [spin](https://github.com/mvdnes/spin-rs) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/mvdnes/spin-rs/releases)
- [Changelog](https://github.com/mvdnes/spin-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mvdnes/spin-rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ty <zonyitoo@users.noreply.github.com>
2021-01-18 17:27:29 +08:00
dependabot-preview[bot] 1d28f09c33 Bump tokio from 1.0.1 to 1.0.2 (#386)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.0.1...tokio-1.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-18 17:25:54 +08:00
dependabot-preview[bot] 6c7c5fec1a Bump tower from 0.3.1 to 0.4.2 (#383)
Bumps [tower](https://github.com/tower-rs/tower) from 0.3.1 to 0.4.2.
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-12 10:42:51 +08:00
dependabot-preview[bot]andty 78aba280ca Bump pin-project from 1.0.3 to 1.0.4 (#381)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.3...v1.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: ty <zonyitoo@users.noreply.github.com>
2021-01-12 09:21:11 +08:00
zonyitoo dd830c70ae allow customizing worker-threads for multi-threaded scheduler
fixes #379
2021-01-09 10:43:11 +08:00
zonyitoo 9000b31ffb Disable deprecated stream ciphers by default
- Enable stream ciphers explicitly with stream-cipher feature
- Upgraded shadowsocks-crypto to v0.1.2

fixes #373
2021-01-04 23:09:12 +08:00
zonyitoo 7467d51f99 update toolchain nightly-2020-12-30 2020-12-31 21:40:43 +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 2bcc40c4f7 upgrade to trust-dns-resolver v0.20 release 2020-12-30 09:16:20 +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 fc17623c9e add useful logs about association drops 2020-12-22 00:28:10 +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
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 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 741e019da6 Remove deps to mio v0.6 and update all dependencies
fix #321
2020-11-21 22:54:53 +08:00
zonyitoo e9366e1236 strum is still required for RedirType 2020-11-21 14:07:16 +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 2d533e0592 ProxyUpstream sending queries with both TCP & UDP if possible 2020-11-15 14:23:21 +08:00
zonyitoo e6e526b0b5 trust-dns works with tokio 0.3
- extends "dns" config field to ResolverConfig
2020-11-15 14:23:21 +08:00
zonyitoo 2f3a6d34bf Deps to hyper and tower dev branch 2020-11-15 14:23:21 +08:00
zonyitoo 08d0871742 Support SIP008 extend server fields server, server_port, remarks 2020-11-15 14:23:21 +08:00