fusion

module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: GPL-3.0

README

Fusion

Fusion is a library which implements the Fusion Framing Protocol (FFP). The Fusion Framing Protocol (FFP) is proprietary networking protocol which uses a small and lightweight header with a performance as fast as raw tcp performance. Built directly on top of Go's net.Listener with support for plain tcp and tls encrypted connections. The implementation for the Client is FusionKit written in swift on top of Network.framework to ensure maximum performance.

License:

License

Golang Version:

Golang 1.16 Golang 1.16

Installation:

Go Modules

Go Modules. Just add this repo to your go.sum file.

Import:

// import the framework
import "github.com/Vinz1911/fusion/network"

// create a new connection listener
listener := network.Listener{}

// ...

Callback:

// create a new connection listener
listener := network.Listener{}

// listener is ready
listener.Ready = func(socket net.Conn) { }

// listener received message from a connection
listener.Message = func(conn net.Conn, binary []byte, opcode uint8) {
	// message is text based
    if opcode == network.TextMessage { println(string(binary)) }
    // message is binary based
    if binary == network.BinaryMessage { println(len(binary)) }
}

// listener connection failed
listener.Failed = func(conn net.Conn, err error) { }

// listener connection cancelled
listener.Cancelled = func(conn net.Conn) { }

// start listener
err := listener.Start(network.TCPConnection, uint16(7878))

Author:

👨🏼‍💻 Vinzenz Weist

Directories

Path Synopsis
Package network encapsulates functionalities related to network communication.
Package network encapsulates functionalities related to network communication.

Jump to

Keyboard shortcuts

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