Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: create re-usable Shadowsocks service #206

Merged
merged 16 commits into from
Sep 18, 2024
Merged

Conversation

sbruens
Copy link

@sbruens sbruens commented Sep 6, 2024

This service will be shared by Caddy module in forthcoming PR.

@sbruens sbruens changed the title refactor: create re-usable service that can be shared by forthcoming Caddy module refactor: create re-usable service to be shared by Caddy module Sep 6, 2024
@sbruens sbruens changed the title refactor: create re-usable service to be shared by Caddy module refactor: create re-usable Shadowsocks service Sep 9, 2024
@sbruens sbruens requested a review from fortuna September 9, 2024 19:18
@sbruens sbruens marked this pull request as ready for review September 9, 2024 19:18
@sbruens sbruens requested a review from a team as a code owner September 9, 2024 19:18
service/shadowsocks.go Show resolved Hide resolved
service/shadowsocks.go Show resolved Hide resolved
service/shadowsocks.go Outdated Show resolved Hide resolved
service/shadowsocks.go Outdated Show resolved Hide resolved
prometheus/metrics.go Outdated Show resolved Hide resolved
cmd/outline-ss-server/main.go Outdated Show resolved Hide resolved
@sbruens sbruens changed the base branch from master to sbruens/optional-metrics September 16, 2024 21:47
metrics ServiceMetrics
ciphers CipherList
natTimeout time.Duration
replayCache *ReplayCache
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the replayCache be nil?

Copy link
Author

@sbruens sbruens Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can. The implementation of ReplayCache includes a safeguard against nil pointers:

if c == nil || c.capacity == 0 {

That's probably why we don't explicitly safeguard against it in NewShadowsocksStreamAuthenticator(). I'm not sure if this pattern is idiomatic in Go?

Base automatically changed from sbruens/optional-metrics to master September 16, 2024 22:35
@sbruens sbruens merged commit b561f49 into master Sep 18, 2024
5 checks passed
@sbruens sbruens deleted the sbruens/service branch September 18, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants