gortc / stun

Fast RFC 5389 STUN implementation in go
BSD 3-Clause "New" or "Revised" License
493 stars 53 forks source link

long-term credential ? #29

Closed notedit closed 7 years ago

notedit commented 7 years ago

any long-term credential mechanism like coturn?

ernado commented 7 years ago

Hi! I think user handling is out of scope of stun implementation. This package implements only RFC, not the applications (but I think I will add simple stun server and some utilities as subpackages soon). Also there is NewLongTermIntegrity function, so it is already available to check credentials for particular stun message.

m := new(stun.Message)
m.ReadFrom(conn) // conn is io.Reader
i := stun.NewLongTermIntegrity("username", "realm", "password")
if err := i.Check(m); err != nil {
    fmt.Println("check failed:", err)
}

It definitely will be in turn server, tho.

notedit commented 7 years ago

ye it better be in a server module