socks5-server/credentials.go
2024-01-12 22:22:40 -08:00

21 lines
346 B
Go

package main
import (
"encoding/json"
)
type Credentials struct {
Username string `json:"username"`
Password string `json:"password"`
}
func parseCredentials(credsString string) ([]Credentials, error) {
var creds []Credentials
err := json.Unmarshal([]byte(credsString), &creds)
if err != nil {
return nil, err
}
return creds, nil
}