gorelay
gorelay is a tool for relaying data streams from a source (like an NTRIP caster) to a local TCP port. It supports TCP, NTRIP, and NTRIP with TLS connections.
Building
This project uses a Makefile for building the executable.
-
To build the gorelay executable for your current system, run:
make build
-
To build with the race detector enabled, run:
make build-race
-
To cross-compile for Linux, macOS, and Windows, run:
make cross-build
The binaries will be placed in the bin/ directory.
-
To clean up the build artifacts, run:
make clean
Usage
gorelay is configured using an XML file. To run the tool, use the -c or --config flag to specify the path to your configuration file:
./gorelay -c config.xml
Flags
-c, --config: Path to the XML configuration file (required).
-v, --version: Show the version information.
Configuration
The configuration file is an XML file that contains one or more <connection> elements. Each <connection> element defines a data stream to be relayed.
Connection Types
tcp: A plain TCP connection.
ntrip: An NTRIP connection.
tls_ntrip: An NTRIP connection with TLS.
Example Configuration
<config>
<connection>
<name>MyNTRIPStream</name>
<type>ntrip</type>
<host>caster.example.com:2101</host>
<mountpoint>RTCM3</mountpoint>
<user>myuser</user>
<password>mypassword</password>
<out_port>9000</out_port>
</connection>
<connection>
<name>MyTCPStream</name>
<type>tcp</type>
<host>data.example.com:8000</host>
<out_port>9001</out_port>
</connection>
</config>
In this example:
gorelay will connect to an NTRIP caster at caster.example.com:2101, mountpoint RTCM3, and relay the data to local port 9000.
gorelay will also connect to a TCP server at data.example.com:8000 and relay the data to local port 9001.