Skip to content
Build Automated Anonymous Applications using Ricochet (and Go) - Mirror of an Open Privacy Project
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Godeps Adding bulb to godep Aug 5, 2017
application add application integration test: (#42) May 30, 2018
channels
connection BUGFIX: deadlock May 9, 2018
examples/echobot add application integration test: (#42) May 30, 2018
identity Identity Tests Jan 14, 2018
policies Fixing minor govet / misspell issue Nov 4, 2017
testing add application integration test: (#42) May 30, 2018
utils fmt and travis update May 9, 2018
wire
.gitignore Add script for coveralls Nov 8, 2016
.travis.yml
CONTRIBUTING.md Fixing a few golint issues Jan 5, 2018
LICENSE Brand new API v0.2 May 2, 2017
README.md Update README.md Nov 2, 2017
inbound_version_negotiation_test.go
outbound_version_negotiation_test.go
private_key Refactor GoRicochet Jul 3, 2016
ricochet.go
ricochet_test.go Adding Open Connection Failed Test Jan 3, 2018
testing.md

README.md

GoRicochet Build Status Go Report Card Coverage Status

GoRicochet 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 (
  "github.com/s-rah/go-ricochet/application"
  "github.com/s-rah/go-ricochet/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.

You can’t perform that action at this time.