You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
packagecom.exampleimportcom.ngrok.Connectionimportcom.ngrok.Listenerimportcom.ngrok.Sessionfunmain() {
val session:Session=Session.withAuthtoken("...").connect()
session.use {
val listener:Listener.Edge= session.edge()
.label("edge", "...")
.listen()
listener.use {
while (true) {
// Accept a new connectionval conn:Connection.Edge= listener.accept()
println("conn.getRemoteAddr() = ${conn.remoteAddr}")
println("conn.inetAddress() = ${conn.inetAddress()}") // Crashes
}
}
}
}
And the log output from running it
conn.getRemoteAddr() = [2a00:23c8:a8dd:e501:b02c:ea1a:83cf:395e]:64440
Exception in thread "main" java.lang.NumberFormatException: For input string: "23c8"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:668)
at java.base/java.lang.Integer.parseInt(Integer.java:786)
at com.ngrok.Connection.inetAddress(Connection.java:25)
at com.example.NgrokIPV6ReproKt.main(NgrokIPV6Repro.kt:21)
at com.example.NgrokIPV6ReproKt.main(NgrokIPV6Repro.kt)
The text was updated successfully, but these errors were encountered:
Thanks for using ngrok-java and reporting this issue. Indeed, we should be using the last column : as a divider between the host and the port of an address, before passing it to InetAddress to create one. Therefore, I've created a PR #31 that amends the logic to do so. Don't hesitate to reach out if you have any other issues or comments with our library.
Here's a minimal repro
And the log output from running it
The text was updated successfully, but these errors were encountered: