# README
Golang lua-vm
简体中文 Golang lua minimum project
Library
- bit
- buffer
- crypto
- fs
- hash
- io
- net
- regexp
- store
Features
- http/sock5 proxy
- lua pool
- file system
Installing
go get -u github.com/vlorc/lua-vm
Quick Start
- Create Pool
pool.NewLuaPool()
- Preload Script
pool.NewLuaPool().Preload(
pool.Source(strings.NewReader("print('hello')")),
pool.Value("tobuffer", base.ToBuffer),
)
Examples
- Use tcp
import (
"github.com/vlorc/lua-vm/pool"
"github.com/vlorc/lua-vm/net/tcp"
"github.com/vlorc/lua-vm/net/base"
)
func main() {
p := pool.NewLuaPool().Preload(
pool.Module("net.tcp", tcp.NewTCPFactory(driver.DirectDriver{})),
pool.Module("buffer", base.BufferFactory{}),
)
if err := p.DoFile("demo/tcp.lua"); nil != err {
println("error: ", err.Error())
}
}
Lua Demo
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author