metacoma / 9sandbox

1 stars 0 forks source link

Create a web page that uses styx/p9 protocol to connect to alpha container #5

Closed metacoma closed 5 years ago

metacoma commented 5 years ago

http://9p.cat-v.org/implementations

http://man.cat-v.org/plan_9/2/9p

metacoma commented 5 years ago

https://github.com/aiju/jsdrawterm

metacoma commented 5 years ago

https://github.com/rsbohn/9pJSON

metacoma commented 5 years ago

https://github.com/sirnewton01/9webdraw/tree/master/web/js/lib9p

metacoma commented 5 years ago

from plan9@irc.freenode.net

20:40 < henesy> So you could probably write a server-side websocket listener
20:40 < henesy> Then write a websocket 9p client in that somehow translates to something on the web page
20:40 < henesy> To listen for websockets you basically need a full http stack so it’ll be kinda heavy
20:40 < henesy> This is probably trivial in Go tho

https://github.com/novnc/websockify https://github.com/novnc/websockify-other/tree/master/c

https://github.com/tg123/websockify-nginx-module

metacoma commented 5 years ago

Native plan9 websocket2p9 app https://bitbucket.org/dhoskin/weebsocket/src/default/

metacoma commented 5 years ago

https://www.npmjs.com/package/9p

metacoma commented 5 years ago

intermediate result in 3_js_styx branch

$ git clone https://github.com/metacoma/9sandbox
$ cd 9sandbox
$ git checkout 3_js_styx
$ docker-compose build
$ docker-compose pull
$ docker-compose up

....

$ docker-compose exec nodejs-sandbox nodejs
> var _9p = require('9p');
> var WebSocket = require('ws') 

> var sock = new _9p.WebSocketReadWriter("ws://http/alpha")
> var enc = new _9p.Encoder(sock)
> var decoder = new _9p.Decoder(sock)
> enc.tattach(0,1,"foobar", "/")
metacoma commented 5 years ago

9p-over-websocket