stun_dart 0.1.0+1-dev copy "stun_dart: ^0.1.0+1-dev" to clipboard
stun_dart: ^0.1.0+1-dev copied to clipboard

Simple plug and play stun client for dart. This will let you know your current public IP, port and NAT type details.

example/main.dart

import "package:stun_dart/stun.dart";

void main() async {
  int _responseCounter = 0;
  initializeStun(callback: (String selfAddress) {
    var response = calculateResponse();
    print(selfAddress);
    print(response.result);
    print(response.natType);
    _responseCounter++;
  });
  while (_responseCounter < 7) {
    await Future.delayed(Duration(seconds: 2));
  }
  await stopStunning();
}
0
likes
40
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Simple plug and play stun client for dart. This will let you know your current public IP, port and NAT type details.

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

dart_stringprep, uuid

More

Packages that depend on stun_dart