Skip to content

qsocket/qsocket-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QSocket Go

Go library for qsocket...

Documentation

GoDoc Go Report Card License: MIT

Warning

This library is in its early alpha development stage, featuring experimental functionality that may lack backwards compatibility, and users are advised to exercise caution and not use it in production environments.

Example

Usage is really simple, qsocket.NewSocket() function simply creates a new quantum socket with given secret, it includes all the functions of standard net sockets and also implements io Read/Write. After creating a socket you need to dial the QSRN network by calling Dial* functions. Simple example below...

    // Create a new QSocket client...
    qsock := qsocket.NewSocket(qsocket.Client, "my-secret");
    // Create a new QSocket server...
    qsock := qsocket.NewSocket(qsocket.Server, "my-secret");
    
    qsock.Dial(true)  // Dial using TLS...
    // OR
    qsock.Dial(false) // Dial using TCP... 

    // Dial using a socks5 proxy over TLS
    qsock.SetProxy("127.0.0.1:9050")
    qsock.Dial(true)

After dialing the QSRN, socket is ready for read/write operations. Check here and qs-netcat for more usage examples.