grwc

package module
v0.0.0-...-ccb71f0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: AGPL-3.0 Imports: 10 Imported by: 1

README

grwc

alt text

GRWC gob reconnecting websocket for service relay

Features

  • specify topic to relay
  • set connection exclusivity (unique or all)
  • gob/de-gobbing of srgob messages

What happened?

Using grwc and crossbar together to relay ssh would have forced clients to be aware of the stream multiplexing, which wasn't all that pretty - it meant all clients received all streams from that service, for a start. That wasn't necessarily a security risk because of encryption (no worse than any other relay), but no one wants a mess under the carpet like sending data that isn't going to be used. A better idea came along - that being shellbar, which yields a cleaner and more efficient design because it can work with sa to do the multiplexing of multiple clients streams as an issue handled solely between the server and the relay, leaving clients none-the-wiser and less burdened with spam.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Cancel              context.CancelFunc
	Context             context.Context
	Destination         string
	ExclusiveConnection bool
	ID                  string
	Receive             chan []byte
	ReceiveGob          chan srgob.Message
	Send                chan []byte
	Topic               string
	Websocket           *reconws.ReconWs
}

func New

func New(config *Config) (*Client, error)

func (*Client) RelayIn

func (c *Client) RelayIn()

receive messages from websocket server until stopped

func (*Client) RelayOut

func (c *Client) RelayOut()

relay messages from the hub to the websocket client until stopped

func (*Client) Run

func (c *Client) Run(closed chan struct{})

type Config

type Config struct {
	Destination         string
	ExclusiveConnection bool
}

Jump to

Keyboard shortcuts

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