Golang Client for querying Tor network data using the Onionoo service.

gonion

Lightweight Golang wrapper for querying Tor network data using the Onionoo service.

GoDoc Go Report Card

package main

import (
        "github.com/R4yGM/gonion"
        "net/http"
        "time"
        "fmt"
)

func main(){

        var netClient = &http.Client{
                Timeout: time.Second * 10,
        }

        g := gonion.Client{HttpClient: netClient}
        res := g.Details(gonion.Params{Search : "R4y", Running: true, RecommendedVersion: true})
        fmt.Println(res.Relays[0].Nickname)
}

Installation

The Golang wrapper has been tested with Golang 1.6+. It may worker with older versions although it has not been tested.

To use it, just include it to your import and run go get:

go get github.com/R4yGM/gonion
import (
	...
	"github.com/R4yGM/gonion"
)

Usage

gonion contains a function for each method available on the onionoo service, check them here https://metrics.torproject.org/onionoo.html#methods

which are :

Summary()
Details()
Bandwidth()
Weights()
Clients()
Uptime()

and all the results are put inside on the respective structs inside the file structs.go, you can also check the responses here https://metrics.torproject.org/onionoo.html#responses that are the same of the structs

Parameters

you can insert all the parameters you want that are listed here https://metrics.torproject.org/onionoo.html#parameters inside the gonion.Params{} struct

Similar Resources

oniongrok forwards ports on the local host to remote Onion addresses as Tor hidden services and vice-versa

oniongrok Onion addresses for anything. oniongrok forwards ports on the local host to remote Onion addresses as Tor hidden services and vice-versa. Wh

Jan 1, 2023

This service is intented to collect data using grpc using Go lang backend and cassandra DB as storage

Go Data Collection This service is intented to collect data using grpc using Go lang backend and cassandra DB as storage. Dev Setup make test_env make

Apr 13, 2022

Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service.

Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service. Program can take large input files.

Feb 6, 2022

Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and deadline support. MIT Licensed.

socket Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and d

Dec 14, 2022

Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Dec 31, 2022

Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface).

windows-ndi-optimizer[WIP] Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface). How it works This is batchfile d

Apr 15, 2022

A simple network analyzer that capture http network traffic

A simple network analyzer that capture http network traffic

httpcap A simple network analyzer that captures http network traffic. support Windows/MacOS/Linux/OpenWrt(x64) https only capture clienthello colorful

Oct 25, 2022

Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.

Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.

Thank you for your interest in ZASentinel ZASentinel helps organizations improve information security by providing a better and simpler way to protect

Nov 1, 2022

Collect Data Service (Client & Server)

Collect Data Service (Client & Server)

Dec 30, 2021
Comments
  • Refactor, unit and integration tests, doc

    Refactor, unit and integration tests, doc

    In this PR, there is a big refactor made for interconnectability of this wrapper with different implementation of an HTTP Client (through the interface gonion.HTTPClient). This approach makes possible the unit and integration tests, but also using a custom implementation of an HTTP client with a more complex strategy (with request caching, or even a circuit breaking implementation). Notice it removes the client structure while it does not implement a strategy (like handling a token or setting up the server URL in the requests). It decreases the shadowing of the wrapper.

    While there is now unit tests with a good code coverage, you could add a badge in the README.md (I suggest using codecov.io) to promote the module.

    To sum up what it embeds:

    • update Go to 1.17
    • interface for the HTTP Client improves interoperability
    • refactor the parameters structure handling using gorilla/schema module
    • refactor wrapper functions according to new client and parameters
    • unit tests (100% code coverage)
    • integration tests (discovered undocumented fields)
    • doc update and clean up
  • Update and API improvement

    Update and API improvement

    What does this PR contains :

    • :date: Update to Go 1.19
    • :date: Update workflow actions to latest stable versions
    • :rotating_light: Update dependencies to fix CVE-2022-28948 (not affected but raises an alert on dependencies scanners)
    • :pencil: Add functional options to request, enabling to manipulate the request's context (see Dave Cheney's blog post and Uber's Go style guide)
    • :pencil: Add .details.bridges.contact field to support recent changes
    • :pencil: Replace interface{} by any, according to Go 1.18 new best practice

    This PR is backward compatible.

Proxtor - A simple tool to connect to the network using Tor

Proxtor A simple tool to connect to the network using Tor. Installing Go to rele

Jan 1, 2022
An experimental Tor-Proxy serivce written in Go using Go-proxy and Go-libtor.

tor-proxy An experimental standalone tor-proxy service built with Go, using go-proxy, go-libtor and bine. This is a simple replacement to Tor's origin

Nov 9, 2022
Kick dropper is a very simple and leightweight demonstration of SQL querying, and injection by parsing URl's

__ __ __ __ _____ ______ | |/ |__|.----.| |--.______| \.----.| |.-----.-----.-----.----.

Feb 6, 2022
A lightweight and simplistic Tor library for golang

gotor A lightweight and simplistic Tor library for golang go get github.com/ripmeep/gotor import "github.com/ripmeep/gotor" Usage t := tor.TorConnecti

Jul 2, 2022
Remake of the original sqlifinder but in GOlang, and allows for listed targets, domain crawling, and tor connections
Remake of the original sqlifinder but in GOlang, and allows for listed targets, domain crawling, and tor connections

_______ _____ _____ _______ _____ __ _ ______ _______ ______ |______ | __| | | |______ | | \ | | \ |______ |_____/

Jan 4, 2023
Tor ready router

DPI installing don't forget to replace the username with your username: mkdir build cd build wget https://openresty.org/download/openresty-1.19.9.1.ta

Feb 13, 2022
meek is a blocking-resistant pluggable transport for Tor.

meek is a blocking-resistant pluggable transport for Tor. It encodes a data stream as a sequence of HTTPS requests and responses. Requests are reflect

Nov 9, 2021
IP2Proxy Go package allows users to query an IP address to determine if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.

IP2Proxy Go Package This package allows user to query an IP address if it was being used as VPN anonymizer, open proxies, web proxies, Tor exits, data

Sep 15, 2022
Vanitytorgen - Vanity Tor keys/onion addresses generator

Vanity Tor keys/onion addresses generator Assumptions You know what you are doing. You know where to copy the output files. You know how to set up a H

May 12, 2022
A Tor package updater and runner as an I2P Plugin
A Tor package updater and runner as an I2P Plugin

i2p.plugins.tor-updater A Tor package updater and runner as an I2P Plugin. This plugin is still being changed rapidly but it should be usable on most

Jul 31, 2022