Commit Graph
119 Commits
Author SHA1 Message Date
zonyitoo 00c7d3f0aa automatically bump RLIMIT_NOFILE on Unix (except Android)
- https://github.com/golang/go/issues/46279
- http://0pointer.net/blog/file-descriptor-limits.html

The I/O runtime, Tokio and Mio, in this Project won't use select(2), so
it is safe to bump the RLIMIT_NOFILE soft limit to hard limit
automatically.
2022-03-26 23:48:21 +08:00
zonyitoo 5292a25db3 refine documents 2021-11-27 19:21:41 +08:00
zonyitoo 486e1d7279 Local, Server & Manager unified binary ssservice
- fixes #698
- Refactored shadowsocks-rust crate structure. Common code are put into
a separated library
2021-11-27 17:36:16 +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 d11a162893 Republic shadowsocks_crypto as crypto mod, set available_ciphers 2020-11-21 13:18:39 +08:00
luozijun c550913247 Add shadowsocks-crypto 2020-11-21 10:42:56 +08:00
zonyitoo 62832b9ad9 [#149] Setting timeout, udp_timeout, udp_max_associations from opt
Add ManagerConfig for encapsulating add manager's options
Removed Config.timeout, servers should always use ServerConfig.timeout
2020-06-01 21:55:00 +08:00
zonyitoo 7a698e36e7 Removed unnecessary Runtime Handle in servers entry function
BREAKING: run_local, run_server, run_manager have removed Handle parameter
2020-05-10 21:55:03 +08:00
zonyitoo 1204d58161 Expose shadowsocks server client
ref #199
2020-03-02 22:15:38 +08:00
zonyitoo 806f44244a Support ACL rules in server (both TCP and UDP)
ref: shadowsocks/shadowsocks-android#2452

Reformatted logs
2020-02-23 13:42:54 +08:00
zonyitoo 70784d12c1 Manager supports Unix Socket 2020-02-10 05:25:10 +08:00
zonyitoo bef28999a5 [#85] Implemented basic manager server listening on UDP 2020-02-08 00:55:39 +08:00
zonyitoo 1806920d12 Check config_type with unified function 2020-01-08 12:21:26 +08:00
zonyitoo d43fe19387 Add a unified entrance for starting server 2020-01-08 12:16:55 +08:00
zonyitoo caf6415cd7 Fixed #185 doc test in lib.rs 2020-01-05 21:08:37 +08:00
zonyitoo 45e8bc63ed Upgrade trust-dns to alpha.3 and bump version to v1.8.0-alpha.3 2019-12-15 22:08:04 +08:00
Y. T. CHUNG a3b33f2614 Migrate to std::future, async/await (#165)
* Socks5 library, main tcp relay implementation migrated with async/await

* UDP relay local migrated to async/await

* UDP relay server migrated to async/await

* Migrated UDP DNS to async/await, follows tokio-process

* Removed unused uses, add dyn keyword for TraitObjects

* [#151] Uses dl.google.com/generate_204 to check connection latency

* Make sslocal/ssserver TCP relay work successfully, disabled UDP and DNS relay temporary

* Handshake before performing actual read & write

* Wraps timeout logic into a Connection<S> struct

* Make UDP relay work again

* Local uses copy directly

* Completely removed unused ssdns

* Fixed test

* Uses tokio::main macro for main entrance

* Fixed a missing use in local.rs

* Updated travis openssl to 1.1.0L

* Windows signal

* Migrated tokio 0.2 release with std::future support

fix #173

* fixed windows monitor build

* Uses tokio on crates.io

* ctrl_c is a Future

* Run tests with single tokio runtime

* Uses spawn_blocking only with threaded runtime

* Killing all detached Tasks if server is exited

* Updated version to v1.8.0

* Removed unused pin-project

* Uses dns resolver built in tokio

* Explicitly uses threaded scheduler by default

* Reverted, it is threaded scheduler by default

* Updated bytes to v0.5

* Updated many dependencies

* Add a tunnel app (#175)

It can be used to benchmark.

Usage:
sstunnel -v -s 127.0.0.1:8488 -m plain -k password -b 127.0.0.1:1090 -f 127.0.0.1:5201

"-f xxx" : the target/forwad address xxx

* Removed unused remote-dns config field (ssdns is removed)

* Separated TCP local tunneling to its own module

* Implements FromStr for Address

* Fixed typo

* Add tunnel unit test

* Updated tokio to v0.2.2, fixed basic scheduler bug

* Removed Connection, uses try_timeout instead. Revert back to use 8K buffer

* Revert "Removed Connection, uses try_timeout instead. Revert back to use 8K buffer"

This reverts commit 82f698e520.

* Uses Delay instead of Timeout

* Delay doesnt return io::Result

* Revert "Delay doesnt return io::Result"

This reverts commit 74dc294d16.

* Fixed bug, Connection timeout should be shared between read & write operations
2019-12-01 12:20:39 +08:00
Linus Färnstrand 3d25b71a20 Remove extern crate statements (#143) 2019-01-26 00:30:06 +08:00
mvd-ows 36d91c68ae Prepare crate for library use (#139)
* Move all process signal monitoring out of the library

* Run plugins with tokio-process and monitor them for exit
2019-01-25 00:05:55 +08:00
Linus Färnstrand afff1982aa Misc simplification (#142)
* Remove unused addr field in Plugin struct

* Replace many Option matches with Option::map and and_then

* Rustfmt run

* Various changes suggested by clippy
2019-01-24 22:14:48 +08:00
zonyitoo 15b742f4f0 [#139] Make signal monitor optional 2019-01-08 00:38:54 +08:00
zonyitoo db04bdb36d Follows config key no_delay and mode in ss-libev 2019-01-01 02:32:20 +08:00
zonyitoo 5dec63a044 Removed all global state maps, which will allow starting multiple shadowsocks instances in one process 2018-12-30 16:02:52 +08:00
zonyitoo 3d9c40ea3d Reformatted 2018-12-30 03:42:51 +08:00
zonyitoo 876342737e Read config with json5 2018-12-30 03:34:17 +08:00
Y. T. Chung c60869aa50 Refactor some boxed futures with impl Trait
- Replaced EncryptedWriterFut and DecryptedReaderFut with impl Trait
- Replaced boxed future in try_timeout and io_timeout with a static type
- Modified rustfmt configuration, fully reformatted
2018-10-01 10:32:04 +08:00
Y. T. Chung ba2cb079a9 Uses spinlock for resolver config 2018-09-23 23:13:11 +08:00
Y. T. Chung f2b402e126 [#119] Configurable DNS server 2018-09-23 17:43:47 +08:00
Y. T. CHUNG 8be6da51f3 Migrate tokio and uses new features (#108)
* Add #102 link in README

* Migrating to tokio, #100

* Migrated to tokio-signal v0.2, reformatted

* Should not call tokio::spawn before tokio::run

* Build nightly and stable with different image tag

* Removed unnecessary rustup install

* Renamed version to v1.7.0-alpha

* Removed deprecated calls of Buf

* Updated dependencies

* [#106] Fixed bug, should not hold UDP connections forever

* Lower info log to debug

* Bump version to v1.7.0-alpha.2

* Implement a simple DNS relay server, bump version to v1.7.0-alpha.3

* Better logging

* Fixed build on travis

* Add elapsed time in log

* Should not exit if handler return error

* reformatted

* Add test for DNS

* Updated ssdns param

* Use `trust-dns` and impl Trait
1. Replaced `ToSocketAddrs` with `trust-dns`
2. Uses impl Trait for functions
3. Updated dependencies
4. Fixed bugs

* Bug fixed, logging crate in ssdns
2018-05-16 00:03:50 +08:00
Y. T. Chung 5c89e61a2e Reformatted with new rustfmt 2018-01-20 01:10:16 +08:00
quininer 32d5a2d9e9 update dependencies (#91)
update dependencies and fix #90
2018-01-08 21:44:35 +08:00
quininer dc8f7e2832 Add experimental SIV support (#81)
* add optional miscreant support

* add miscreant test

* fix miscreant version

* update README

+ add `aes-128-pmac-siv`, `aes-256-pmac-siv`
+ remove `aes-192-gcm`
2017-11-01 16:23:36 +08:00
Y. T. Chung 833f31442d let sslocal supports ssurl 2017-10-29 18:07:57 +08:00
Y. T. Chung 132aaf3ac3 Removed DNS local cache, uses CpuPool with system DNS resolver 2017-10-12 01:57:12 +08:00
Y. T. Chung 91ec4cdbd5 Allow building without libsodium 2017-10-09 01:24:41 +08:00
Y. T. Chung fe07ff33d8 [#61] Add support of chacha20-ietf cipher
Removed sodiumoxide, use self contained libsodium-ffi
2017-08-31 00:40:34 +08:00
Y. T. Chung d1bc1a5713 Removed unused dependencies and upgrade others 2017-08-30 00:07:21 +08:00
Y. T. Chung 7074d6bebc uses bytestring to print salt 2017-08-19 14:00:38 +08:00
Y. T. Chung b6c5b0474d Abort plugin if specific signal received 2017-07-29 12:20:26 +08:00
Y. T. Chung 286a3a4f44 Updated dependencies to the latest version 2017-07-26 00:07:46 +08:00
Y. T. Chung eb580be25a Style and wording improvement
1. Remove Emails
2. Better log for timed out
3. Properly log plugin listening address in server mode
4. Use latest rustfmt and new style configuration
2017-07-24 09:05:41 +08:00
Y. T. Chung 1017160947 fixed #57, Remove Argon2 for key derivation 2017-07-24 00:00:09 +08:00
Y. T. Chung ec49103892 supports SIP003 plugin 2017-07-23 14:04:37 +08:00
Y. T. Chung 8e8d69e58f use netdb instead, which partially supports hosts files. #40 2017-07-02 17:06:20 +08:00
quininer kel 0e1f05a286 Abandon rust-crypto (#47)
* Switch to ring and libsodium
* Updated other dependencies
2017-06-02 18:38:18 +08:00
Y. T. Chung 964d2d4f33 Remove support of multithread 2017-05-30 23:36:58 +08:00
Y. T. Chung f223f238bb share config and handle in global stat 2017-05-21 16:59:28 +08:00
Y. T. Chung c7d183ec8a add global dns cache 2017-05-21 15:11:54 +08:00
Y. T. Chung 47e211e6b1 optimize unnecessary boxed allocation 2017-03-27 03:12:57 +08:00
Y. T. Chung 8ae47907bc upgrade tokio_core, move logics to tokio_io 2017-03-20 00:55:34 +08:00