GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gorcon/rcon: Source RCON Protocol implementation in Go.

BranchesTags
Open more actions menu

Latest commit

 

History

76 Commits
76 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
rcontest
rcontest
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
option.go
option.go
 
 
packet.go
packet.go
 
 
packet_test.go
packet_test.go
 
 
rcon.go
rcon.go
 
 
rcon_test.go
rcon_test.go
 
 

Repository files navigation

Rcon

GitHub Build Go Coverage Go Report Card GoDoc

Source RCON Protocol implementation in Go.

Protocol Specifications

RCON Protocol described in the valve documentation.

Supported Games

Works for any game using the Source RCON Protocol. Tested on:

  • Project Zomboid
  • Conan Exiles
  • Rust (add +rcon.web 0 to the args when starting the server)
  • ARK: Survival Evolved
  • Counter-Strike: Global Offensive
  • Minecraft
  • Palworld
  • Factorio (start the server with --rcon-bind/--rcon-port and --rcon-password args)

Open pull request if you have successfully used a package with another game with rcon support and add it to the list.

Install

go get github.com/gorcon/rcon

See Changelog for release details.

Usage

package main

import (
	"fmt"
	"log"

	"github.com/gorcon/rcon"
)

func main() {
	conn, err := rcon.Dial("127.0.0.1:16260", "password")
	if err != nil {
		log.Fatal(err)
	}
	defer conn.Close()

	response, err := conn.Execute("help")
	if err != nil {
		log.Fatal(err)
	}
	
	fmt.Println(response)	
}

With an existing net.Conn

If you wish to initialize a RCON connection with an already initialized net.Conn, you can use the Open function:

package main

import (
	"fmt"
	"log"
	"net"

	"github.com/gorcon/rcon"
)

func main() {
	netConn, err := net.Dial("tcp", "127.0.0.1:16260")
	if err != nil {
		// Failed to open TCP connection to the server.
		log.Fatalf("expected nil got error: %s", err)
	}
	defer netConn.Close()
	
	conn, err := rcon.Open(netConn, "password")
	if err != nil {
		log.Fatal(err)
	}
	defer conn.Close()

	response, err := conn.Execute("help")
	if err != nil {
		log.Fatal(err)
	}
	
	fmt.Println(response)	
}

Requirements

Go 1.15 or higher

Contribute

Contributions are more than welcome!

If you think that you have found a bug, create an issue and publish the minimum amount of code triggering the bug, so it can be reproduced.

If you want to fix the bug then you can create a pull request. If possible, write a test that will cover this bug.

License

MIT License, see LICENSE

About

Source RCON Protocol implementation in Go.

Topics

gogolanggorconrconrcon-protocolsource-rconsource-rcon-protocolsteamvalve-rcon

Resources

Readme
MIT license
Activity
Custom properties

Stars

122 stars

Watchers

1 watching

Forks

13 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.