Skip to content

Latest commit

 

History

History
22 lines (20 loc) · 429 Bytes

README.md

File metadata and controls

22 lines (20 loc) · 429 Bytes

Source RCON

Requirement

golang 1.21+

To use u need public ip! Otherwise you get panic!!!

func main() {
	client := rcon.NewClient("public_ip", 27015, "password", rcon.WithDeadline(time.Second*3))
	defer client.Close()

	if err := client.Auth(); err != nil {
		log.Fatal(err)
	}

	if response, err := client.Execute("echo hello"); err != nil {
		log.Fatal(err)
	} else {
		log.Println(response)
	}
}