hushcom

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

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

Go to latest
Published: Jan 17, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

README

What is this?

The Hushcom project is a sample distributed IRC-like chat program, which demonstrates how the ratnet project can be used to develop a full application.

The project includes both a client and server program.

Documentation

API Docs are available here: https://godoc.org/github.com/awgh/hushcom

Hushcom Client

The main executable is in the hushcom/ folder, which also includes a REST-ful web interface that serves the actual UI to the browser.

The client/ folder implements the message handling/passing logic of the client.

Hushcom Server

The main executable is in the hushcomd/ folder.

The server/ folder implements the message handling/passing logic of the server.

Hushcom Points of Interest

Hushcom is interesting as an example for several reasons:

  • Implements signed and authenticated messages over ratnet, which does not normally provide them. This is meant to demonstrate how easy this is to do using existing components, as well as providing tested sample code to accomplish this.

  • Implements a browser-based UI using a REST interface and internal web server.

  • Cross-compiles to Android, where it has been deployed as an APK (native hushcomd plus simple UI app that just opens a browser widget to localhost)

  • Distributed IRC scheme. The Hushcom server only knows user and channel names and PUBLIC keys. The server cannot read the contents of any channel or private messages.

#Demo

There is an include webix-based demo which can be launched with the "go.bat" or "go.sh" command from the "wwwtest" directory. This will launch two client sessions which can be connected to via:

SSL Certs are self-signed, so you will likely have to click through some warnings.

From this point, you can create user profiles, add and join channels, and talk to yourself from one browser session to the other.

#Authors and Contributors

awgh@awgh.org (@awgh)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignMsg

func SignMsg(key bc.PubKey, msg Msg) ([]byte, error)

SignMsg - Sign a message (key is not base64 here)

func VerifyMsg

func VerifyMsg(key bc.PubKey, msg Msg) bool

VerifyMsg - Verify a message signature

Types

type Channel

type Channel struct {
	Name   string
	PubKey string // this should be base64 encoded
}

Channel - Common Representation of a Channel

type ChannelMsg

type ChannelMsg struct {
	Channel string
	Text    string
}

ChannelMsg - Message in a channel

type JoinChanMsg

type JoinChanMsg struct {
	Channel   string
	ReqPubKey string // b64 pubkey
	Password  string
}

JoinChanMsg - Join channel request

type JoinChanRespMsg

type JoinChanRespMsg struct {
	Channel    string
	ChannelKey string // this should be base64 encoded
}

JoinChanRespMsg - Join channel response

type ListChansRespMsg

type ListChansRespMsg struct {
	Channels []Channel
}

ListChansRespMsg - List channels response

type Msg

type Msg struct {
	From      string // nick of sender, signed by sender
	Timestamp int64  // timestamp set and signed by sender
	MsgType   string // verb, signed by sender
	Data      []byte // inner data, typically JSON
	Sig       []byte // signature of (From + Timestamp + MsgType + msg)
}

Msg - Core message struct for HC messages

func (Msg) SignMe

func (inst Msg) SignMe() []byte

SignMe - convert a message to a byte array for signing purposes only

type NewChanMsg

type NewChanMsg struct {
	ChanName     string
	ChanPubKey   string // b64 pubkey
	ChanPassword string
}

NewChanMsg - Create a new channel

type RegisterMsg

type RegisterMsg struct {
	Key string // b64 pubkey
}

RegisterMsg - Register a new user/pubkey pair

type RegisterRespMsg

type RegisterRespMsg struct {
	Success bool
}

RegisterRespMsg - Registration response message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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