shadowsocks / shadowsocks/shadowsocks-rust

Signal handling: switch servers, reload config, etc.

Open
#313 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
10.9k
Forks
1.5k
Avg merge
4d 15h
Merged PRs (30d)
5

Description

A useful but missing feature: when the currently connected server is slow, the user should be able to tell sslocal to switch to another server immediately.

We can take a leaf out of tor's signal handling book:

SIGHUP
    The signal instructs Tor to reload its configuration (including closing and
    reopening logs), and kill and restart its helper processes if applicable.

SIGUSR1
    Log statistics about current connections, past connections, and throughput.

SIGUSR2
    Switch all logs to loglevel debug. You can go back to the old loglevels by
    sending a SIGHUP.

Analogously, sslocal would remember the config passed via -c, and reload it upon receiving SIGHUP. We can use SIGUSR1 for "switch servers now" (perhaps lowering the "score" of the previous server, too, basically marking it as kind of slow right now... if sslocal keeps such a "score" on servers, that is. And if so, SIGHUP should also reset all server scores.)

What do you think?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating sslocal's signal-handling and configuration entry points, especially how the config passed via -c is retained. Define the reload and server-switch behavior for SIGHUP and SIGUSR1, including any server scoring and logging implications. Done means the behavior is implemented and covered by tests, though the issue names no existing files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.