Help us shape the future of Go! Take the 2026 Go Developer Survey

devproxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package devproxy is the dev proxy of umono theme dev. It forwards every request to .dev/server and changes the responses only as live reload and the error overlay need.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name     string
	Errors   []string
	Warnings []string
}

Event is a message of /_umono-dev/events. Name is "reload" (reload the page), "css" (only assets/theme.css changed, swap its stylesheet) or "error" (show the errors in the overlay).

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy forwards requests to .dev/server. It is an http.Handler.

func New

func New(target string) (*Proxy, error)

New returns a proxy to target, the URL of .dev/server.

func (*Proxy) Publish

func (p *Proxy) Publish(e Event)

Publish sends e to every open /_umono-dev/events. Its errors and warnings are the state that a new stream gets first, as a "state" event.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) SetTarget

func (p *Proxy) SetTarget(target string) error

SetTarget points the proxy at target, the URL of .dev/server, which changes when .dev/server restarts on another port.

Jump to

Keyboard shortcuts

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