https://github.com/lucko/bytesocks-java-client
A Java client for bytesocks
https://github.com/lucko/bytesocks-java-client
Last synced: 10 months ago
JSON representation
A Java client for bytesocks
- Host: GitHub
- URL: https://github.com/lucko/bytesocks-java-client
- Owner: lucko
- License: mit
- Created: 2023-03-07T22:04:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-05T21:48:11.000Z (over 1 year ago)
- Last Synced: 2025-04-08T17:09:36.378Z (over 1 year ago)
- Language: Java
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# bytesocks-java-client
Java client library for [bytesocks](https://github.com/lucko/bytesocks).
Repo: `https://oss.sonatype.org/content/repositories/snapshots/`
Artifact: `me.lucko:bytesocks-java-client:1.0-SNAPSHOT`

### Example Usage
```java
// Create a client
String host = "bytesocks.example.com";
String userAgent = "github.com/example/your-application";
BytesocksClient client = BytesocksClientFactory.newClient(host, userAgent);
// create a new socket connection
BytesocksClient.Listener listener = new BytesocksClient.Listener() {
@Override
public void onText(String data) {
System.out.println("Got data from channel: " + data);
}
};
BytesocksClient.Socket socket = client.createAndConnect(listener);
System.out.println("Now connected to channel " + socket.getChannelId());
// Send a message to the channel
socket.send("Hello!");
```