wazero_net

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 15 Imported by: 0

README

WAZERO NET

this project provider net/http for wazero, it not belong to wazero's official project

Dial's Conn can not convert to net.TCPConn,net.UDPConn

Install

go get github.com/labulakalia/wazero_net@v0.0.4

Example

must use go version >= go1.24, because go1.24 will support go:wasmexport directive to export function

Install Required Go Version = 1.24

cd example
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o http.wasm http.go
go run example.go http
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o net.wasm net.go
go run example.go net
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o ftp.wasm ftp.go
go run example.go ftp

Todo

  • support ip,unix addr
  • add unit test

Some Limit

https://go.dev/blog/wasi#limitations, this is example code

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFuncExport

func InitFuncExport(r wazero.Runtime) wazero.HostModuleBuilder

Types

type HostNet

type HostNet struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
wasi
net

Jump to

Keyboard shortcuts

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