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
pub points
0%
popularity

Publisher

unverified uploader

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