wsecho

command
v0.5.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 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

Command wsecho is a WebSocket echo server and a client for it. The kind end-to-end test uses both to check that a WebSocket handshake through Traefik and Envoy Gateway is inspected: an allowed one upgrades and echoes, a denied one gets no upgrade (#276).

The server answers a WebSocket handshake on any path, from any origin, and echoes every message; any other request gets 200 "ok".

wsecho -listen :8080

The client sends one handshake, with the headers given, and prints "upgraded" when the server answered 101 Switching Protocols and echoed a message (-message, or a greeting), the status code it answered instead (403, ...), or "closed CODE" when it closed the WebSocket with that code instead of echoing (1008, ...).

go run ./hack/wsecho -host ws.example.com -origin https://app.example.com 127.0.0.1:18091/chat

Jump to

Keyboard shortcuts

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