Skip to content

DEBANMC/valve-rcon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Valve RCON server implementation

Simple server implementation for the RCON protocol.

Example usage

package main

import (
	"log"

	rcon "github.com/crossworth/valve-rcon"
)

const (
	host     = "0.0.0.0"
	port     = rcon.DefaultPort
	password = "test"
)

func main() {
	server := rcon.NewRCON(host, port, password)
	server.SetBanList([]string{
		"192.168.0.10",
		// ...
	})

	// echo server
	server.OnCommand(func(command string, client rcon.Client) {
		log.Printf("command: %s", command)
		_ = client.Write("server: " + command)
	})

	err := server.ListenAndServe()
	if err != nil {
		log.Fatalln(err)
	}
}

About

Valve RCON server implementation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%