{"id":20741198,"url":"https://github.com/bbottema/java-socks-proxy-server","last_synced_at":"2025-04-04T23:10:01.157Z","repository":{"id":43103417,"uuid":"225848264","full_name":"bbottema/java-socks-proxy-server","owner":"bbottema","description":"Java SOCKS 4/5 server implementation for Java","archived":false,"fork":false,"pushed_at":"2024-10-02T09:05:48.000Z","size":77,"stargazers_count":95,"open_issues_count":1,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T22:14:31.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbottema.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-04T11:12:57.000Z","updated_at":"2025-03-28T03:37:45.000Z","dependencies_parsed_at":"2024-03-14T11:28:27.224Z","dependency_job_id":"dce1453f-0752-48de-80d8-e54c58770c45","html_url":"https://github.com/bbottema/java-socks-proxy-server","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Fjava-socks-proxy-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Fjava-socks-proxy-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Fjava-socks-proxy-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbottema%2Fjava-socks-proxy-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbottema","download_url":"https://codeload.github.com/bbottema/java-socks-proxy-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261612,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T06:34:57.702Z","updated_at":"2025-04-04T23:10:01.141Z","avatar_url":"https://github.com/bbottema.png","language":"Java","funding_links":[],"categories":["网络编程"],"sub_categories":[],"readme":"[![APACHE v2 License](https://img.shields.io/badge/license-apachev2-blue.svg?style=flat)](LICENSE-2.0.txt) \n[![Latest Release](https://img.shields.io/maven-central/v/com.github.bbottema/java-socks-proxy-server.svg?style=flat)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.bbottema%22%20AND%20a%3A%22java-socks-proxy-server%22) \n[![Javadocs](http://www.javadoc.io/badge/com.github.bbottema/java-socks-proxy-server.svg)](http://www.javadoc.io/doc/com.github.bbottema/java-socks-proxy-server)\n[![Codacy](https://img.shields.io/codacy/grade/3d5316af468d4234bf9b783def62b416.svg?style=flat)](https://www.codacy.com/gh/bbottema/java-socks-proxy-server)\n\n# java-socks-proxy-server\n*java-socks-proxy-server* is a SOCKS 4/5 server for Java. Includes a JUnit Rule for easy testing with a SOCKS server.\n\nIt is a continuation of https://github.com/damico/java-socks-proxy-server.\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.bbottema\u003c/groupId\u003e\n  \u003cartifactId\u003ejava-socks-proxy-server\u003c/artifactId\u003e\n  \u003cversion\u003e4.1.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage:\n\n```java\n// start serving clients on port 1234\nSocksServer server = new SocksServer(1234).start();\n...\nserver.stop(); // stop serving any new proxy requests\n```\n\nOr you can supply your own `ServerSocketFactory`:\n\n```java\n// e.g. SSL on port 7132\nSocksServer server = new SocksServer(1234, myCustomServerFactory).start();\n```\n\n\u003e By default, library uses `NO_AUTH` authentication mode\n\n### Username and Password Authentication\n\nIf you want to authenticate the clients, before proxying, you can set a `UsernamePasswordAuthenticator`, library supports standard Username/Password protocol.\n\n```java\n    new SocksServer(1234)\n        .setAuthenticator(new UsernamePasswordAuthenticator(false) {\n          @Override\n          public boolean validate(String username, String password) {\n            // validate credentials here, e.g. check your local database\n            return username.equals(\"mysecureusername\") \u0026\u0026 password.equals(\"mysecurepassword\");\n          }\n        }).start();\n```\n\n\u003e Supply a `true` value to constructor `UsernamePasswordAuthenticator()`, if you also want to prefer `NO_AUTH` mode over Username and password.\n\nFor use in junit 5 tests (for Junit 4 use a version \u003c 3.0.0):\n\n```\n@RegisterExtension\nstatic SockServerExtension sockServerRule = new SockServerExtension(PROXY_SERVER_PORT);\n\n// or\n\n@RegisterExtension\nstatic SockServerExtension sockServerRule = new SockServerExtension(PROXY_SERVER_PORT, myServerSocketFactory);\n```\n\nAnd that's it!\n\n## Change history\n\nv4.1.2 (02-October-2024)\n- [#15](https://github.com/bbottema/java-socks-proxy-server/issues/15): [bug+maintenance] Current version doesn't assign default authentication handler properly, address nullability and superfluous method chaining.\n\n\nv4.1.0 (15-May-2024)\nv4.1.1 (duplicate release)\n\n- [#14](https://github.com/bbottema/java-socks-proxy-server/issues/14): Enhanced dynamic username/password authentication support for custom validation strategies.\n- Minor performance improvements based on SpotBugs recommendations.\n\nNOTE: the start methods have been marked deprecated. For serving clienst on multiple ports, create a new instance of the server for each port.\n\n\nv4.0.0 (21-April-2024)\n\n- Maintenance release: upgraded parent POM version, switched to Junit5, updated dependencies, added SpotBugs checks.\n\n\nv3.0.0 (22-Januray-2024)\n\n- [#12](https://github.com/bbottema/java-socks-proxy-server/issues/12): Added a more robust server adaptation with synchronous startup (including retries), shutdown closes all connections. With thanks to @kllbzz\n\n\nv2.0.0 (26-December-2021)\n\n- Switched to Java 8 and included fix for recent log4j security issue\n\n\nv1.1.0 (15-April-2021)\n\n- [#4](https://github.com/bbottema/java-socks-proxy-server/issues/4) added support for custom server socket factory (so you are free to configure SSL)\n\n\nv1.0.2 (5-July-2020)\n\n- Bumped log4j-core from 2.6.1 to 2.13.2\n\n\nv1.0.1 (6-December-2019)\n\n- Removed Jacoco instrumentation from production code\n\n\nv1.0.0 (6-December-2019)\n\nInitial release\n\n\n4-December-2019\n\nInitial upload","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbottema%2Fjava-socks-proxy-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbottema%2Fjava-socks-proxy-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbottema%2Fjava-socks-proxy-server/lists"}