Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xomadev/stunclient
https://github.com/xomadev/stunclient
java rfc-5389 stun-client
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xomadev/stunclient
- Owner: XomaDev
- License: apache-2.0
- Created: 2024-05-27T15:21:35.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-01T20:49:52.000Z (7 months ago)
- Last Synced: 2024-06-01T23:26:10.622Z (7 months ago)
- Topics: java, rfc-5389, stun-client
- Language: Java
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Stun Client
Standard Stun client (RFC 5389) implementation in Java
## Usage
Create a reusable `StunClient` object
```java
StunClient client = new StunClient("stun.l.google.com", 19302);
// or new StunClient(stunInetAddress, port);
```Execute a request to the stun server
```java
StunResponse response = client.request();// StunResponse{type=Ipv4, address=/...51.1..7.225, port=13474}
InetAddress address = response.address;
int port = response.port;
boolean isIpv4 = response.type == StunResponse.TYPE_IPV4;
```