sse

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 9 Imported by: 2

README

sse + ws + http

# sse
curl -H 'Accept: text/event-stream' -N http://127.0.0.1:8080
firefox ws://localhost:8080

# ws
websocat ws://[::1]:8080
websocat ws://localhost:8080

# http
curl http://127.0.0.1:8080/once

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSE

type SSE struct {
	Data string

	Clients            map[int]chan struct{}
	MaxMessageInterval time.Duration
	// contains filtered or unexported fields
}

func NewSSE

func NewSSE() *SSE

func (*SSE) ServeHTTP

func (s *SSE) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*SSE) SetData

func (s *SSE) SetData(data string)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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