Skip to content

mmulet/libgotty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run gotty as a library. Cast your current running go program to the web!

Build

make

which will make libgotty.so.

See ./example/main.go for example usage, but the general idea is:

// capture all program i/o
io := libgotty.CaptureIO()
// start a web server to forward all i/o to the browser
go libgotty.Server(io,...)

The key is that you can call captureIO/serve to display in the webserver, then later on release the capture. YOu don't have to commit the entire program to the browser like you would by using gotty. You don't have to commit to displaying on the browser at the program level. For example you could parse some args like

$my_program --web-version

and only afterwards display on the web.

Or you can do some secure setup before hand in the terminal, then afterwards do the rest in the web. Etc.

Alternatives

If you don't need to resume your program after running on the web, it is probably better to use embedgotty.

About

Run gotty as a library, mirror your current running go program to the web!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors