Attachment is an attachment handler used in emit args. All attachments will be sent as binary data in the transport layer. When using an attachment, make sure it is a pointer.

For example:

type Arg struct {
    Title string `json:"title"`
    File *Attachment `json:"file"`

f, _ := os.Open("./some_file")
arg := Arg{
    Title: "some_file",
    File: &Attachment{
        Data: f,

socket.Emit("send file", arg)
socket.On("get file", func(so Socket, arg Arg) {
    b, _ := ioutil.ReadAll(arg.File.Data)

Attachment is referenced in 1 repository