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

wsupstream

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package wsupstream is the one WebSocket test upstream (ADR-0181): an httptest server over x/net/websocket that records each request's ContentLength and serves the query parameter mode.

  • echo (the default) replies echo:<frame> to every frame;
  • sink replies echo:<frame> only to a frame starting probe:;
  • push echoes like echo and also sends push:<n> every `every` (a duration query parameter).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	URL string
	// contains filtered or unexported fields
}

Server is a running WebSocket test upstream, closed by the test's Cleanup.

func New

func New(tb testing.TB) *Server

New starts a Server closed by tb.Cleanup.

func (*Server) ContentLengths

func (s *Server) ContentLengths() []int64

ContentLengths returns the ContentLength of every request received, in arrival order.

func (*Server) Ended

func (s *Server) Ended() int

Ended returns how many WebSocket connections have ended because their pending read failed.

Jump to

Keyboard shortcuts

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