A go written library for the RCON Protocol.
Find a file
2021-03-07 18:30:09 +01:00
.drone.yml Add Drone CI setup 2021-03-06 16:19:24 +01:00
.gitignore Add gitignore 2021-03-06 16:20:39 +01:00
go.mod Add go module 2021-03-02 18:39:59 +01:00
LICENSE Add copyright holder 2021-03-02 18:40:51 +01:00
rcon.go Add missing return documentation for errors 2021-03-07 17:58:16 +01:00
rcon_test.go Split test into subtests 2021-03-07 17:55:39 +01:00
README.md Add project README.md 2021-03-07 18:30:09 +01:00

rcon

A go written library for the RCON Protocol.

This is a fork from james4k/rcon with the support for go modules and with a rework of the original implementation for better readability.

Usage

// Espablish a connection.
remoteConsole, err := rcon.Dial("127.0.0.1", "password")
if err != nil {
    fmt.Println(err)
}

// Send a command.
requestID, err := remoteConsole.Write("command")
if err != nil {
    fmt.Println(err)
}

// Read the response
response, responseID, err := remoteConsole.Read()
if err != nil {
    fmt.Println(err)
}
if requestID != responseID {
    fmt.Println("response id doesn't match the request id!")
}

fmt.Println(response)

License

This lib is licesed under the MIT License

Contributors

If you should encaunter a bug or a missing feature dont hessitate to open an issue or even submit a pull-request.

Special thx to nhh and dnltinney for the great help debugging this lib.