ws

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ws provides a WebSocket implementation of the MCP transport.

This package implements the Transport interface using WebSockets, suitable for web applications requiring bidirectional communication.

Index

Constants

View Source
const DefaultShutdownTimeout = 10 * time.Second

DefaultShutdownTimeout is the default timeout for graceful shutdown

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	transport.BaseTransport
	// contains filtered or unexported fields
}

Transport implements the transport.Transport interface for WebSocket

func NewTransport

func NewTransport(addr string) *Transport

NewTransport creates a new WebSocket transport

func (*Transport) Initialize

func (t *Transport) Initialize() error

Initialize initializes the transport

func (*Transport) Receive

func (t *Transport) Receive() ([]byte, error)

Receive receives a message (client mode only)

func (*Transport) Send

func (t *Transport) Send(message []byte) error

Send sends a message

func (*Transport) Start

func (t *Transport) Start() error

Start starts the transport

func (*Transport) Stop

func (t *Transport) Stop() error

Stop stops the transport

Jump to

Keyboard shortcuts

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