This repository has been archived on 2020-04-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Sarah Jamie Lewis 5066380655 v3 onions 2018-10-05 13:06:54 -07:00
Godeps Adding bulb to godep 2017-08-05 12:48:25 -07:00
application v3 onions 2018-10-05 13:06:54 -07:00
channels v3 onions 2018-10-05 13:06:54 -07:00
connection v3 onions 2018-10-05 13:06:54 -07:00
examples/echobot Rename 2018-06-08 15:05:22 -07:00
identity v3 onions 2018-10-05 13:06:54 -07:00
policies Rename 2018-06-08 15:05:22 -07:00
testing v3 onions 2018-10-05 13:06:54 -07:00
utils v3 onions 2018-10-05 13:06:54 -07:00
wire v3 onions 2018-10-05 13:06:54 -07:00
.drone.yml .drone: use openpriv version of drone-gogs 2018-07-17 12:06:55 -05:00
.gitignore drone build file 2018-07-02 13:16:43 -05:00
.travis.yml fmt and travis update 2018-05-09 12:40:07 -07:00
CONTRIBUTING.md Rename 2018-06-08 15:05:22 -07:00
LICENSE ricochet protobuf files, for completeness 2018-07-05 16:49:52 -05:00
README.md Rename 2018-06-08 15:05:22 -07:00
inbound_version_negotiation_test.go Rename 2018-06-08 15:05:22 -07:00
outbound_version_negotiation_test.go Rename 2018-06-08 15:05:22 -07:00
private_key Refactor GoRicochet 2016-07-02 18:52:28 -07:00
ricochet.go Rename 2018-06-08 15:05:22 -07:00
ricochet_test.go Adding Open Connection Failed Test 2018-01-03 10:20:53 -08:00
testing.md Adding Open Connection Failed Test 2018-01-03 10:20:53 -08:00

README.md

libricochet-go Build Status Go Report Card Coverage Status

libricochet-go is an experimental implementation of the Ricochet Protocol in Go.

Features

  • A simple API that you can use to build Automated Ricochet Applications
  • A suite of regression tests that test protocol compliance.

Building an Automated Ricochet Application

Below is a simple echo bot, which responds to any chat message. You can also find this code under examples/echobot

package main

import (
  "git.openprivacy.ca/openprivacy/libricochet-go/application"
  "git.openprivacy.ca/openprivacy/libricochet-go/utils"
  "log"
  "time"
)

func main() {
  echobot := new(application.RicochetApplication)
  pk, err := utils.LoadPrivateKeyFromFile("./private_key")

  if err != nil {
    log.Fatalf("error reading private key file: %v", err)
  }

  l, err := application.SetupOnion("127.0.0.1:9051", "tcp4", "", pk, 9878)

  if err != nil {
    log.Fatalf("error setting up onion service: %v", err)
  }

  echobot.Init(pk, new(application.AcceptAllContactManager))
  echobot.OnChatMessage(func(rai *application.RicochetApplicationInstance, id uint32, timestamp time.Time, message string) {
    log.Printf("message from %v - %v", rai.RemoteHostname, message)
    rai.SendChatMessage(message)
  })
  log.Printf("echobot listening on %s", l.Addr().String())
  echobot.Run(l)
}

Each automated ricochet service can extend of the StandardRicochetService. From there certain functions can be extended to fully build out a complete application.

Security and Usage Note

This project is experimental and has not been independently reviewed. If you are looking for a quick and easy way to use ricochet please check out Ricochet IM.