Commit Graph

76 Commits

Author SHA1 Message Date
ty
9eefc2db3e feat: update hickory-resolver v0.25 public release
- ref hickory-dns/hickory-dns#2206

reformatted with 1.85 new formatter
2025-03-19 12:50:53 +08:00
ClaytonKnittel
8416f6dab8 refactor: change error handling to be strongly-typed (#1834)
* Refactor error handling to be strongly-typed.

* Remove unused function.

* Remove comment.

* Add module + type docstrings.

* Make error module private.

* Fix windows build.
2025-01-07 19:25:30 +08:00
zonyitoo
609de80b47 chore: make clippy happy 2024-02-01 21:48:23 +08:00
zonyitoo
268e520a72 feat(sswinservice): Running ssservice as a Windows Service
ref #1292

https://learn.microsoft.com/en-us/windows/win32/services/about-services
2023-09-19 00:29:35 +08:00
zonyitoo
c0ba7f044d fix(ssurl): make outline url optional
ref #1287
2023-09-12 01:26:06 +08:00
Sorochan Ilya
a47fc19e08 ssurl: add support for SIP008 links (ssconf links with ss contents) (#1287)
Co-authored-by: k0tran <>
2023-09-07 13:25:48 +08:00
zonyitoo
e3855b4a8d clippy --fix 2022-12-18 11:32:46 +08:00
zonyitoo
8953210907 "acl" is available in ext-config "servers" & "locals"
The "acl" in "servers" & "locals" will have higher priority than the
global "acl" in configuration.

fix #1042
2022-12-10 17:49:43 +08:00
zonyitoo
45cc770ef4 ssservice genkey, helper for generate encryption key 2022-10-17 22:29:35 +08:00
zonyitoo
817f106777 upgrade clap v4.0 2022-10-07 15:51:58 +08:00
Shun Sakai
f57d50659f Change the return type of the main function
Since Rust 1.61.0, the `main` function can return a type that
implements the `Termination` trait.
By this, the `main` function can return custom exit codes, so use this.
2022-06-13 11:26:50 +08:00
ty
7c154d2340 AEAD-2022 ciphers (new protocol) (#811) 2022-04-19 11:48:43 +08:00
John
12eadcdd39 remove deprecated code for clap 3.1.0 (#774) 2022-02-25 10:46:18 +08:00
zonyitoo
66e192e894 fix(ssservice): fixed command line option when running as symlink of ssserver/ssmanager 2022-02-21 22:02:02 +08:00
zonyitoo
9ef0b31f91 upgrade clap to v3.0 2022-01-05 20:12:53 +08:00
zonyitoo
89d9e66338 ssservice support symlinked by sslocal, ssserver, ssmanager 2021-11-27 17:36:16 +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
48e822d104 fixed build warning on Windows 2021-11-27 00:22:23 +08:00
zonyitoo
1eff9b1883 remove redundant clone and Into for RemoteDnsAddress 2021-11-26 00:43:05 +08:00
zonyitoo
1dc0c2a363 make clippy happy 2021-11-26 00:12:13 +08:00
zonyitoo
7aec233271 command line --password also support ${VAR_NAME} syntax
- use the original text instead of empty string if ${VAR_NAME} 's
VAR_NAME doesn't exist

ref #419
2021-11-25 23:54:23 +08:00
zonyitoo
11262f5f99 refactored command line options getter with clap::value_t! 2021-11-25 20:21:50 +08:00
zonyitoo
0b5933b4b6 ssmanager won't use read_server_password 2021-11-25 17:33:14 +08:00
zonyitoo
74e8a4f8f5 Reading password from environment variable or TTY
- servers creating from command line options would use TTY,
SS_SERVER_PASSWORD and SS_SERVER_${SERVER_ADDR}_PASSWORD environment
variables
- servers in configuration file "password" would allow ${VAR_NAME} to
read from environment variable VAR_NAME

fixes #419
2021-11-25 17:19:16 +08:00
zonyitoo
aaac00f208 SS_LOG_VERBOSE_LEVEL and SS_LOG_WITHOUT_TIME environment variable
ref #691
2021-11-25 16:15:49 +08:00
zonyitoo
fa3a2a83d2 default configuration file (config.json) for Windows, Linux, macOS
- $XDG_CONFIG_PATH/shadowsocks-rust/config.json
- $HOME/.config/shadowsocks-rust/config.json
- {FOLDERID_RoamingAppData}\shadowsocks\shadowsocks-rust\config\config.json
- $HOME/Library/Application Support/org.shadowsocks.shadowsocks-rust/config.json

fixes #688
2021-11-25 15:14:07 +08:00
zonyitoo
7b1b67fe44 local-dns remote-dns-addr will have default port 53
fixes #683
2021-11-15 12:27:47 +08:00
zonyitoo
da6473be09 servers created from command-line should have tcp_only default mode
fixes #670
2021-11-08 18:30:47 +08:00
Zimo Li
183b4bf0ca Fix spelling (#667)
* spelling: active

* spelling: availability

* spelling: because

* spelling: behavior

* spelling: browsers

* spelling: excessive

* spelling: extended

* spelling: insecure

* spelling: miscellaneous

* *spelling: negotiate

* spelling: particular

* spelling: readiness

* spelling: recommended

* spelling: response

* spelling: respectively

* spelling: reassemble

* spelling: Shadowsocks

* spelling: simultaneously

* spelling: silent

* spelling: stabilized

* spelling: unexpectedly

* *spelling: UNEXPECTEDLY

Co-authored-by: Zimo Li <lzm0@users.noreply.github.com>
2021-11-05 01:17:24 +08:00
zonyitoo
e46d57936f support outbound-bind-interface for Windows 2021-10-23 17:32:15 +08:00
zonyitoo
fa4a6928c1 fixed warning & update dependencies 2021-10-15 20:30:25 +08:00
zonyitoo
a9e2f372c4 support ssmanager server standalone mode
- fixes #648
- allow restarting ssmanager without killing all running ssservers
2021-10-15 19:02:18 +08:00
spyophobia
cba7fa4c3b daemon starts in pwd (#640)
This is the default behavior when not daemonizing.
2021-10-08 03:44:47 +08:00
zonyitoo
a77ea0b304 make clippy happy, update dependencies 2021-10-08 01:24:07 +08:00
zonyitoo
593630833c Revert "remove chroot when daemonizing (#640)"
This reverts commit 862a8a78b7.
2021-10-08 01:16:06 +08:00
zonyitoo
42451a3e39 fixed bug. auto-reload "servers" should also reload plugins 2021-10-08 01:10:58 +08:00
zonyitoo
862a8a78b7 remove chroot when daemonizing (#640) 2021-10-08 00:13:55 +08:00
zonyitoo
76dfdbaaf6 print errno if daemonize failed 2021-10-08 00:03:24 +08:00
zonyitoo
3fdad5a401 reload config "servers" in runtime for sslocal
- Trigger reload with signal SIGUSR1
- run_local is replaced by create_local then call run() on Server
instance
- DNS resolver reloader won't trigger multiple time when
/etc/resolv.conf changed in 1 second
2021-10-06 02:33:00 +08:00
zonyitoo
0c96cf5840 log BUILD_TIME and bump version to v1.12.0-alpha.5 2021-09-25 23:20:33 +08:00
ty
337ab16adb Local server support Tun interface for both TCP and UDP (#586)
* [POC] basic implementation of TCP redirecting tun (#581)

* [POC] basic implementation of UDP redirection of Tun

* build with action

* add configuration interface for tun

* refine document and command line options

* outbound-bind-addr instead of reusing local_address for outbound sockets

* support customizing udp expiry and capacity

* make clippy happy

* fixed build error for Android

* add docs

* make a customized AsyncFd with the released tun crate

* TUN_INTERFACE_NAME to_owned directly

* ignore accept errors for tcp tun

* tun supports Android only on master branch

* android doesnt support setting IFF_NO_PI

* set route for macos automatically when creating tun

* set route for macos directly with PF_ROUTE

* Linux-like uses ETH_P_IP and ETH_P_IPV6

* use tun on crates.io and ignores Android support temporary

* update dependencies
2021-08-22 04:49:53 +08:00
zonyitoo
fc40cef2c3 ssmanager support default --plugin and --plugin-opts
- fixes #421
2021-08-17 17:35:36 +08:00
zonyitoo
97bb489293 set Mode::UdpOnly via command line -u
- fixes #577
- Why the original code use merge instead of replace?
2021-07-21 12:48:06 +08:00
zonyitoo
402cdcb1d9 updated exitcode as standard defined in sysexits.h 2021-07-11 21:35:34 +08:00
zonyitoo
5d232ca123 exit with code instead of panic! when loading config and ACL errors
- fixes #566
2021-07-10 02:33:30 +08:00
zonyitoo
420e4511d3 add manager debug strings 2021-06-13 08:14:31 +08:00
zonyitoo
d61d1028a5 add tcp-keep-alive command line option
- ref #546
2021-06-07 03:17:44 +08:00
zonyitoo
f0f1ab59cd properly set available redir types for TCP and UDP separately 2021-05-15 00:40:21 +08:00
zonyitoo
6c75ce19f4 support snmalloc and rpmalloc 2021-05-07 11:35:35 +08:00
ty
4dfcc8e036 Manage UDP associations with LFU strategy (#506)
* manage UDP associations with LFU

- DNS associations could be evicted firstly then others like HTTP/3

* UDP redir caches inbound non-local socket

- Optimization: prevent creating new sockets for the same remotes

* updated libc to v0.2.94 for unified TCP options

* make clippy happy

* Pin lfu-cache to v1.2.1 for edward-shen/lfu-cache#2

* UDP target should cache with expiration 1hrs

* UDP tunnel test with an echo server

- CI crashes occasionally because of 8.8.8.8:53 doesn't respond
2021-04-28 01:27:33 +08:00