We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anyone can give me some example code implement server accounting at port 1813
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
how about the port ? when server get started it will listen on port 1812 udp for authentication/authorization ?
package main import ( "log" "layeh.com/radius" "layeh.com/radius/rfc2865" ) func main() { handler := func(w radius.ResponseWriter, r *radius.Request) { username := rfc2865.UserName_GetString(r.Packet) password := rfc2865.UserPassword_GetString(r.Packet) var code radius.Code if username == "tim" && password == "12345" { code = radius.CodeAccessAccept } else { code = radius.CodeAccessReject } log.Printf("Writing %v to %v", code, r.RemoteAddr) w.Write(r.Response(code)) } server := radius.PacketServer{ Handler: radius.HandlerFunc(handler), SecretSource: radius.StaticSecretSource([]byte(`secret`)), } log.Printf("Starting server on :1812") if err := server.ListenAndServe(); err != nil { log.Fatal(err) } }
No branches or pull requests
anyone can give me some example code implement server accounting at port 1813
The text was updated successfully, but these errors were encountered: