A simple FTP protocol with client and server implemented in TypeScript and Golang

websocket-ftp

A simple FTP protocol with client and server implemented in TypeScript and Golang.

Example (Client)

{ console.log("Transfer has started.") }, onprogress: (r, t) => console.log(`Sent ${r} / ${t} bytes`), onsuccess: () => console.log("Success!"), onclose: () => console.log("Closed WS connection"), }, )">
const buffer: Uint8Array = (new TextEncode()).encode("Testing Text")

new Transfer(
    "ws://example.server.com/filetransfer",
    [
        {
            Name: "Test File",
            Size: buffer.length,
            Type: "application/octet-stream",
            data: buffer
        },
    ],
    {
        onstart: () => {
            console.log("Transfer has started.")
        },
        onprogress: (r, t) => console.log(`Sent ${r} / ${t} bytes`),
        onsuccess: () =>
            console.log("Success!"),
        onclose: () =>
            console.log("Closed WS connection"),
    },
)

Example (Server)

type Hooks struct{}

func (h Hooks) OnTransferRequest(metadata TransferMetadata) chan bool {
    log.Println("Got requests", metadata)
    c := make(chan bool, 1)
    c <- true
    return c
}

func (h Hooks) OnTransferUpdate(t *Transfer) {
    log.Println(
        "Progress",
        t.State.Received,
        "/",
        t.Data.Files[t.State.CurrentFile].Size,
    )
}

func (h Hooks) OnTransfersComplete(id string) {
    log.Println("Transfer", id, "is complete")
}

SetServerConfig(ServerConfig{Handlers: Hooks{}})
Serve()
Similar Resources

Group peer to peer video calls for everyone written in Go and TypeScript

Peer Calls v4 WebRTC peer to peer calls for everyone. See it live in action at peercalls.com. The server has been completely rewriten in Go and all th

Dec 30, 2022

Example of strongly typed go/graphql/typescript web application

go-gql-typescript-example Example of strongly typed go/graphql/typescript web application Overview This is an example web application. On the server i

May 27, 2022

The high-performance build system for JavaScript & TypeScript codebases

The high-performance build system for JavaScript & TypeScript codebases

Documentation Visit https://turborepo.org to view the full documentation. Community To chat with other community members, you can join the Turborepo D

Jan 4, 2023

Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.

Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.

pingser Use pingser to create client and server based on ICMP Protocol to send and receive custom message content. examples source code: ./examples Us

Nov 9, 2022

Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021

wire protocol for multiplexing connections or streams into a single connection, based on a subset of the SSH Connection Protocol

qmux qmux is a wire protocol for multiplexing connections or streams into a single connection. It is based on the SSH Connection Protocol, which is th

Dec 26, 2022

A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server Warning: This project is in active development and is likely very buggy. A Language Server Protocol (LSP) server for Jsonnet.

Nov 22, 2022
FTP server in Golang - Donovan and Kernighan´s excercise 8.2

This is my implementation of Exercise 8.2 in Donovan and Kernighan’s “The Go Programming Language”. With a LOT of help from Angus Morrison´s article h

Feb 6, 2022
FTP client package for Go

goftp A FTP client package for Go Install go get -u github.com/jlaffaye/ftp Documentation https://pkg.go.dev/github.com/jlaffaye/ftp?tab=doc Example

Jan 7, 2023
An experimental go FTP server framework

graval Go FTP server framework. By providing a simple driver class that responds to a handful of methods you can have a complete FTP server. Some samp

Sep 27, 2022
Grab your files periodically from a remote FTP or SFTP server easily
Grab your files periodically from a remote FTP or SFTP server easily

About FTPGrab is a CLI application written in Go and delivered as a single executable (and a Docker image) to grab your files from a remote FTP or SFT

Jan 3, 2023
Access ftp through caddy

Access ftp through caddy

Dec 14, 2022
A simple tool to convert socket5 proxy protocol to http proxy protocol

Socket5 to HTTP 这是一个超简单的 Socket5 代理转换成 HTTP 代理的小工具。 如何安装? Golang 用户 # Required Go 1.17+ go install github.com/mritd/s2h@master Docker 用户 docker pull m

Jan 2, 2023
The HomeKit Accessory Protocol (hap) implemented in Go
The HomeKit Accessory Protocol (hap) implemented in Go

hap hap (previously hc) is a lightweight library to develop HomeKit accessories in Go. It abstracts the HomeKit Accessory Protocol (HAP) and makes it

Jan 8, 2023
gRPC Web implementation for Golang and TypeScript

gRPC-Web: Typed Frontend Development gRPC is a modern, HTTP2-based protocol, that provides RPC semantics using the strongly-typed binary data format o

Dec 29, 2022
Transform Golang `enum` type to Typescript enum

golang-enum-to-ts Transform Golang enum type to Typescript enum Function Before (Golang) package some type Status int const ( Todo Status = iota D

Mar 1, 2022
Generate Typescript types from Golang source code

?? tygo Tygo is a tool for generating Typescript typings from Golang source files that just works. Other than reflection-based methods it preserves co

Dec 16, 2022