-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add auth and version support to socks proxy #883
Conversation
server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some general cleanup
server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt
Outdated
Show resolved
Hide resolved
serverConfig.socksProxyUsername, | ||
serverConfig.socksProxyPassword, | ||
) { proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword -> | ||
data class DataClassForDestruction( | ||
val proxyEnabled: Boolean, | ||
val proxyHost: String, | ||
val proxyPort: String, | ||
val proxyUsername: String, | ||
val proxyPassword: String, | ||
) | ||
DataClassForDestruction(proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverConfig.socksProxyUsername, | |
serverConfig.socksProxyPassword, | |
) { proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword -> | |
data class DataClassForDestruction( | |
val proxyEnabled: Boolean, | |
val proxyHost: String, | |
val proxyPort: String, | |
val proxyUsername: String, | |
val proxyPassword: String, | |
) | |
DataClassForDestruction(proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword) | |
}, | |
serverConfig.socksProxyUsername, | |
serverConfig.socksProxyPassword, | |
) { proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword -> | |
data class ProxySettings( | |
val proxyEnabled: Boolean, | |
val proxyHost: String, | |
val proxyPort: String, | |
val proxyUsername: String, | |
val proxyPassword: String, | |
) | |
ProxySettings(proxyEnabled, proxyHost, proxyPort, proxyUsername, proxyPassword) | |
}.distinctUntilChanged(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just to be safe.
Might as well add support for socks 4 by providing java's |
closes #785
I didn't test the code against a real proxy but it should be fine according to the docs.
Java 8: https://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html#socks
Java 20 (much more readable): https://docs.oracle.com/en/java/javase/20/core/java-networking.html#GUID-E0E7F3CF-FF30-4324-B2F8-AA88EB067994