3 ms·
Show HN: A golang websocket server you can pipe to
- mseepgood 13y agogo get github.com/minikomi/pipesock ln -s $GOPATH/src/github.com/minikomi/pipesock/default ~/.pipesock
- minikomi 13y agoAh, thanks. You might also need to go get code.google.com/p/go.net/websocket if you haven't already.
- mseepgood 13y agogo get fetches it automatically.
- shakesbeard 13y agoYou could use the following to get the path to your assets. import ( "go/build" "path/filepath" ) pkgInfo, err := build.Import("github.com/minikomi/pipesock", "", 0) if err != nil { panic(err) } webDirPath := filepath.Join(pkgInfo.Dir, "default")
- minikomi 13y agoThat's a much cleaner idea, thanks. I'll investigate it. edit: Thanks, I went with this.
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- codebeaker 13y agoSo no installation instructions, the ones here don't work (it's not compiled), and it doesn't seem to work (tailing a log file that is receiving new content once per second `while true.... date > mylog; done` - /buffer.json always empty, /flush does nothing except echo "Flushed" and the web interface apparently does nothing...
- codebeaker 13y agoWhy does this start to work once the websocket library is "got" (sic) shouldn't go refuse to build this unless the library is there?
- codebeaker 13y agoAlso, there's a problem: > cat /usr/share/dict/words | ./pipesock 2013/06/01 22:35:59 Read Line Error: EOF 2013/06/01 22:35:59 Read Line Error: EOF 2013/06/01 22:35:59 Read Line Error: EOF 2013/06/01 22:35:59 Read Line Error: EOF This happened when trying to do "y | ./pipesock", amongst other things, perhaps you should silently ignore stuff that isn't streaming in line-based. FWIW the websocket library now installed, I get a single reading in the html frontend, the first message I broadcast. Nice idea, needs a lot more work!
- minikomi 13y agoThank you very much for trying it out and, I agree, I have a lot more work to do. As always, the devil's in the details - and having those details pointed out is a great way to move forward!