Skip to content

websocket can't work when websocket.Message.Send() #197

@yaotian

Description

@yaotian

package controllers

import (
"code.google.com/p/go.net/websocket"
"fmt"
"github.com/robfig/revel"
)

type App struct {
*revel.Controller
}

func (c App) Index() revel.Result {
return c.Render()}

func (c App) Feed(ws *websocket.Conn) revel.Result {
fmt.Println("hi")
message := "hello"
websocket.Message.Send(ws, message)
return nil
}
~

The website can connect and disconnect. But can't get "hello" from html page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions