socket

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package socket connects apps and runners over Unix sockets using HTTP/2 without TLS.

Index

Constants

View Source
const BaseURL = "http://runner"

BaseURL is the base URL for clients returned by Client; the host part is ignored.

Variables

This section is empty.

Functions

func Client

func Client(path string) *http.Client

Client returns an HTTP/2 client that dials the Unix socket at path.

func Listen

func Listen(ctx context.Context, path string) (net.Listener, error)

Listen creates a Unix socket at path that only its owner can use, replacing a stale one.

func ListenShared added in v0.4.0

func ListenShared(ctx context.Context, path string) (net.Listener, error)

ListenShared creates a Unix socket at path as Listen does, then makes it usable by every user as Share does.

func NewServer

func NewServer(h http.Handler) *http.Server

NewServer returns a server for h that speaks HTTP/1.1 and HTTP/2 without TLS and has timeouts set. A stream that moves in neither direction for 60 seconds is cut; one that keeps moving may run as long as it needs.

func Share added in v0.4.0

func Share(path string) error

Share makes the socket at path, which Listen made, usable by every user: for a peer that runs as another user. The folder the socket is in then decides who reaches it. It refuses anything at path but a socket.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL