Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"math/rand"
"time"
)
type Stream chan interface{}
type StreamMap func(interface{}) interface{}
package main
import(
"net"
"fmt"
"bufio"
"time"
)
var emit chan []byte
package main
import (
"fmt"
"github.com/gorilla/websocket"
"net/http"
"time"
)
func main() {
@sophia-ooo
sophia-ooo / go websocket client
Created March 4, 2014 01:31
go websocket client
package main
import (
"fmt"
"code.google.com/p/go.net/websocket"
)
func main() {
ws, err := websocket.Dial("ws://localhost:80/ws/", "", "http://localhost")
if err != nil {