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

Refactored and separate library into crates #345

Merged
merged 57 commits into from
Dec 20, 2020
Merged

Conversation

zonyitoo
Copy link
Collaborator

@zonyitoo zonyitoo commented Dec 13, 2020

  • shadowsocks: the core shadowsocks library
  • shadowsocks-service:
    • server
    • manager
    • local
      • socks5, socks4/4a
      • tunnel
      • http/https
      • redir
      • dns
  • shadowsocks-rust: release binaries
  • tests

ref #326.

This PR will also fixes #343 , #232 .

- shadowsocks: the core feature of shadowsocks
- shadowsocks-service: local, server, manager and other tools to run
shadowsocks services
- shadowsocks-rust: release binaries
@zonyitoo zonyitoo marked this pull request as draft December 13, 2020 04:10
@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from 60afbc6 to 6170b9b Compare December 15, 2020 14:59
@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from 3616f1b to 62ff011 Compare December 15, 2020 17:29
@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from faa8995 to 7cce6cd Compare December 17, 2020 15:49
@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from 7cce6cd to 79876a1 Compare December 17, 2020 15:56
@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from adb8398 to aa3822d Compare December 19, 2020 18:59
@madeye
Copy link
Contributor

madeye commented Dec 19, 2020

I think this PR is almost ready for shadowsocks-android.

BTW, still see one warning:

warning: unused import: `ErrorKind`  --> crates/shadowsocks-service/src/local/socks/server/mod.rs:4:16 

@zonyitoo zonyitoo force-pushed the feature-separate-crates branch from 456c21b to afde4bc Compare December 20, 2020 06:38
@zonyitoo
Copy link
Collaborator Author

zonyitoo commented Dec 20, 2020

There still have some dependencies that migrating to tokio v0.3 are not released.

@zonyitoo zonyitoo self-assigned this Dec 20, 2020
@zonyitoo zonyitoo marked this pull request as ready for review December 20, 2020 11:03
@zonyitoo zonyitoo merged commit 07583f3 into master Dec 20, 2020
@zonyitoo zonyitoo deleted the feature-separate-crates branch December 20, 2020 11:06
IceCodeNew added a commit to IceCodeNew/rust-collection that referenced this pull request Dec 20, 2020
IceCodeNew added a commit to IceCodeNew/rust-collection that referenced this pull request Dec 23, 2020
@cg31
Copy link

cg31 commented Dec 28, 2020

This is a good move. But how am I supposed to use the crates from other project?

It seems I can't refer to both shadowsocks and shadowsocks-service on github:

[dependencies]
shadowsocks = { git = "https://github.com/shadowsocks/shadowsocks-rust.git", branch = "master" }
# or ???
shadowsocks-server = { git = "https://github.com/shadowsocks/shadowsocks-rust.git", branch = "master" }

I can only clone them to local and use them:

[dependencies]
shadowsocks = { path = "./shadowsocks/crates/shadowsocks" }
shadowsocks-service = { path = "./shadowsocks/crates/shadowsocks-service" }

but this is rather awkward.

@zonyitoo
Copy link
Collaborator Author

[dependencies]
shadowsocks = { git = "https://github.com/shadowsocks/shadowsocks-rust.git", branch = "master" }
shadowsocks-service = { git = "https://github.com/shadowsocks/shadowsocks-rust.git", branch = "master" }

It should work.

IceCodeNew added a commit to IceCodeNew/rust-collection that referenced this pull request Jan 11, 2021
IceCodeNew added a commit to IceCodeNew/rust-collection that referenced this pull request Jan 11, 2021
@Mygod
Copy link
Contributor

Mygod commented Jul 6, 2021

What is DnsClientCache? Caching should be handled by shadowsocks-android since shadowsocks-rust is oblivious to underlying network changes.

@zonyitoo
Copy link
Collaborator Author

zonyitoo commented Jul 6, 2021

What is DnsClientCache? Caching should be handled by shadowsocks-android since shadowsocks-rust is oblivious to underlying network changes.

Just for preventing creating sockets for every queries.

If the underlying network changed, which will definitely cause query failure, then the DnsClientCache will automatically recreate sockets and do it again.

@Mygod
Copy link
Contributor

Mygod commented Jul 6, 2021

Does this fix shadowsocks/shadowsocks-android#2093?

@Mygod
Copy link
Contributor

Mygod commented Jul 6, 2021

Also according to rfc7766, connection reuse can send multiple queries in a single connection. 🤔

@zonyitoo
Copy link
Collaborator Author

zonyitoo commented Jul 6, 2021

Does this fix shadowsocks/shadowsocks-android#2093?

Well, the DnsClientCache should achieve the goal of DNS connection reuse (TCP).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

timeout handling is completely broken
6 participants