Categorygithub.com/JochenHiller/tftp-go
modulepackage
0.0.0-20210329102340-bd0abf5448cc
Repository: https://github.com/jochenhiller/tftp-go.git
Documentation: pkg.go.dev

# README

tftp-go

TFTP server implementation in Go.

Usage

For an example server implementation, see the example directory.

This server provides read/write access to $PWD.

To run the server (from the example directory):

$ go build main.go
$ echo "Hello world!" > file
$ sudo ./main

To access the server with curl (for example):

$ curl tftp://localhost/file
Hello world!

Notes

A client implementation could easily be built on top since the packet serialization/deserialization is in place and not tied to either the server or the client side. If you're looking to build this feature, let us know through an issue on GitHub, or directly with a pull request for this functionality.

RFCs

Other RFCs are informational or obsoleted by newer versions.

  • 1350: THE TFTP PROTOCOL (REVISION 2)
  • 2347: TFTP Option Extension
  • 2348: TFTP Blocksize Option
  • 2349: TFTP Timeout Interval and Transfer Size Options

License

This project is available under the Apache 2.0 license.

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author

# Variables

ErrTimeout is returned by the packetReader when it times out reading a packet.
ZeroConn can be used as a placeholder if otherwise not known.

# Interfaces

Conn provides context about the current "connection".
Handler is the interface a consumer of this library needs to implement to be able to serve TFTP requests.
ReadCloser is what the Handler needs to implement to serve TFTP read requests.
WriteCloser is what the Handler needs to implement to serve TFTP write requests.