FAQ
hi,

I got websocket example which has server.go and client.go...I don't
understand how to run these 2 codes...pls help me....

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Islan Dberry at Jan 20, 2014 at 6:02 pm

    On Monday, January 20, 2014 9:45:49 AM UTC-8, kate Fernando wrote:
    I got websocket example which has server.go and client.go...I don't
    understand how to run these 2 codes...pls help me....
    Without seeing the files, it's difficult to know how they should be run.
      Can you provide more information about the example?

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • kate Fernando at Jan 20, 2014 at 6:44 pm
    thankyou very much for the quick reply....I got the code from following
    website....

    EchoClient.go and EchoServer.go are the 2 files


    http://jan.newmarch.name/go/websockets/chapter-websockets.html

    I tried to
    1.run go run EchoServer.go
    2.ws://localhost:12345/ on browser

    but didn't work

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Islan Dberry at Jan 20, 2014 at 6:50 pm
    Browsers do not support navigation to a ws:// URL. I skimmed the example
    and don't see any support for a browser client.

    It looks like you should be able to 'go run EchoServer.go' and 'go run
    EchoClient.go' and have the two communicate with each other.

    Perhaps the author can provide more help.

    On Monday, January 20, 2014 10:43:59 AM UTC-8, kate Fernando wrote:


    thankyou very much for the quick reply....I got the code from following
    website....

    EchoClient.go and EchoServer.go are the 2 files


    http://jan.newmarch.name/go/websockets/chapter-websockets.html<http://www.google.com/url?q=http%3A%2F%2Fjan.newmarch.name%2Fgo%2Fwebsockets%2Fchapter-websockets.html&sa=D&sntz=1&usg=AFQjCNGIawoTCAELVSh1OLi7k5ZVM672_w>

    I tried to
    1.run go run EchoServer.go
    2.ws://localhost:12345/ on browser

    but didn't work
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • kate Fernando at Jan 20, 2014 at 7:07 pm
    I tried to run this 2 files in 2 cmd without using browser....it gives
    following error...

    C:\newf\src\ch>go run EchoClient.go
    Usage:
    C:\Windows\TEMP\go-build247996675\command-line-arguments\_obj\exe\EchoCl
    ient.exe ws://host:port
    exit status 1


    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Caleb Doxsey at Jan 20, 2014 at 7:40 pm
    You can open a websocket from a browser like this (in Javascript):

    var ws = new WebSocket("ws://localhost:12345");
    ws.onopen = function(evt) {
    console.log("WS OPEN", evt);
    };
    ws.onerror = function(evt) {
    console.log("WS ERROR", evt);
    };
    ws.onmessage = function(evt) {
    console.log("WS MESSAGE", evt.data);
    };
    ws.onclose = function(evt) {
    console.log("WS CLOSE", evt);
    };


    It looks like in your example you need to call:

    go run EchoClient.go ws://localhost:12345


    rather than:

    go run EchoClient.go


    - Caleb

    On Mon, Jan 20, 2014 at 12:07 PM, kate Fernando wrote:


    I tried to run this 2 files in 2 cmd without using browser....it gives
    following error...

    C:\newf\src\ch>go run EchoClient.go
    Usage:
    C:\Windows\TEMP\go-build247996675\command-line-arguments\_obj\exe\EchoCl
    ient.exe ws://host:port
    exit status 1


    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • kate Fernando at Jan 21, 2014 at 2:08 am
    thankyou so much......as your explanation,now it works on the 2
    cmd....thanks again...

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 20, '14 at 5:45p
activeJan 21, '14 at 2:08a
posts7
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase