Code Monkey home page Code Monkey logo

source-rcon's Introduction

Source RCON Protocol

GitHub repo size GitHub issues

See license if you plan to run this software. If you have any doubt contact us.

The Source RCON Protocol is a TCP/IP based communication protocol used by Source Dedicated Server, which allows console commands to be issued to the server via a remote console.

Reference

How to use it?

If you want to use this protocol implementation in your own projects, you only need to execute the next command in your project root directory:

$ go get -u github.com/csgoservers/source-rcon/pkg/protocol

To use it in your code, you first need to specify the connection details like host, port and server password. Then you can create the connection and send commands over it. See the next block to use as a template:

import rcon "github.com/csgoservers/source-rcon/pkg/protocol"

func main() {
  opts := &rcon.Options{
	Host:     "127.0.0.1",
	Port:     27025,
	Password: "1234",
  }
  conn := rcon.New(opts)
  defer conn.Close()

  result, err := conn.ExecCommand("cvarlist")
  if err != nil {
	return
  }
  // transform `result` to a string
}

If you have any issue, please send it here.

CLI

Also, if you only want to execute some commands over a Source Dedicated Servers, then you can execute the rcon-cli application. To use it you just need to clone this repository and execute the make build directive. You can change some flags to configure your server settings. See the table below:

Name Default value Description
-H 127.0.0.1 Host where the server is running
-p 27015 Port where server is listening for connections. TCP
-s Password of the server if any
-c Command to be executed

Note that the -c flag is required in order to run the cli.

For example, if you want to execute the cvarlist command then you will use the following command:

$ ./rcon-cli -H 1.2.3.4 -p 27025 -s 1234 -c cvarlist

Test

If you want to execute all tests from this repository then execute make test.

License

This is not an official Steam product. csgoservers.xyz is not affiliated with Valve Corporation or Counter-Strike

See LICENSE

License

source-rcon's People

Contributors

fooock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kingsh2012

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.