Running binaries
Running binaries is the most basic functionality of Catch. We can run a binary with yeet
like this:
yeet run <service> <binary>
We can also use scp
to upload and run a binary in one step. This is equivalent to using yeet run
.
scp <binary> <service>:
Example
In this example, we'll deploy a simple HTTP server written in Go. However, Catch can run any binary, whether it's written in Go, Rust, Zig, C++, or any other language.
Deploying a Go webserver
Below is a simple HTTP server written in Go that listens on port 8080
. Let's run it on our Catch server.
package main
import "net/http"
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello, World!"))
})
http.ListenAndServe(":8080", nil)
}
We build the binary, naming it server
, and then run it on our server as a service called hello-server
.
go build -o server .
yeet run hello-server ./server
We can check that the service is running with yeet status
.
$ yeet status hello-server
SERVICE TYPE CONTAINER STATUS
hello-server service - running
Our server is running on port 8080
. Let's curl
our server to see that it's running.
$ curl http://<ip-of-server>:8080
Hello, World!
Catch includes a built-in TCP proxy, enabling you to access your services over the Tailnet. This means you can simply curl http://catch:8080
to reach your service.