icmpnet

package module
v0.0.0-...-69029ee Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 12 Imported by: 0

README

Messaging over ICMP

GoDoc

Implementation of client/server bidirectional messaging over ICMP protocol.

Messaging over ICMP is useful - when your network (wifi) gives you an IP address, but won't let you send TCP or UDP packets out to the rest of the internet, but allow you to ping any computer on the internet.

Features:

  • AES encryption is used.
  • Implements standard net.Listener and net.Conn interface to be able to extend for high level protocols such as http, rpc.

Implemented Use-case applications:

  • Message broker and client (each message is a single line)
  • File transfer (used rpc to upload/download file and respond status)

Build

./build.sh

Run

Message Broker Application

Broker

# stop auto reply ping messages for linux
echo 1 | sudo dd of=/proc/sys/net/ipv4/icmp_echo_ignore_all
sudo ./bin/msgbroker -pw <password>

Client

sudo ./bin/msgclient
File Transfer Application

Server

# stop auto reply ping messages for linux
echo 1 | sudo dd of=/proc/sys/net/ipv4/icmp_echo_ignore_all
sudo ./bin/fileserver -pw <password> -dir <file_directory>

Client

sudo ./bin/fileclient

Using the API

Reference

Listen connections at server

listener, err := icmpnet.Listen(aesKey)

Connect to server

addr, _ := net.ResolveIPAddr("ip4", "server_IP")
conn, err := icmpnet.Connect(serverAddr, aesKey)

Please check sample applications in cmd folder.

License

This repository is under MIT License, as found in LICENSE file.

Documentation

Index

Constants

View Source
const Version string = "v0.3"

Version indicates icmpnet version

Variables

This section is empty.

Functions

func Connect

func Connect(server net.Addr, aesKey []byte) (net.Conn, error)

Connect create a connection to server. If aesKey is nil, encryption is disabled.

func Listen

func Listen(aesKey []byte) (net.Listener, error)

Listen creates a new icmp listener (server). If aesKey is nil, encryption is disabled.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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