11 comments

[ 2.8 ms ] story [ 37.6 ms ] thread
go get github.com/minikomi/pipesock

ln -s $GOPATH/src/github.com/minikomi/pipesock/default ~/.pipesock

Ah, thanks. You might also need to go get code.google.com/p/go.net/websocket if you haven't already.
go get fetches it automatically.
You 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")
That's a much cleaner idea, thanks. I'll investigate it. edit: Thanks, I went with this.
(comment deleted)
(comment deleted)
So 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...
Why does this start to work once the websocket library is "got" (sic) shouldn't go refuse to build this unless the library is there?
Also, 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!

Thank 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!