web

package
v1.13.10 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package web implements nostr websockets with their authentication state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

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

func NewSocket

func NewSocket(
	conn *websocket.Conn,
	req *http.Request,
	challenge []byte,
) (ws *Socket)

func (*Socket) AuthRequested

func (ws *Socket) AuthRequested() bool

func (*Socket) Authed

func (ws *Socket) Authed() string

func (*Socket) AuthedBytes

func (ws *Socket) AuthedBytes() []byte

func (*Socket) Challenge

func (ws *Socket) Challenge() string

func (*Socket) Close added in v1.13.9

func (ws *Socket) Close() (err error)

func (*Socket) IsAuthed

func (ws *Socket) IsAuthed() bool

func (*Socket) RealRemote

func (ws *Socket) RealRemote() string

func (*Socket) Req

func (ws *Socket) Req() *http.Request

func (*Socket) RequestAuth

func (ws *Socket) RequestAuth()

func (*Socket) SetAuthed

func (ws *Socket) SetAuthed(s string)

func (*Socket) Write

func (ws *Socket) Write(p []byte) (n int, err error)

func (*Socket) WriteJSON

func (ws *Socket) WriteJSON(any interface{}) error

func (*Socket) WriteMessage

func (ws *Socket) WriteMessage(t int, b []byte) error

Jump to

Keyboard shortcuts

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