0

I am using the momo mac project, to develop and compile a C# websocket on OS X Mountain Lion.
I've used the example websocket from Websocket server: onopen function on the web socket is never called to just get an idea of how it's working. My problem is, I don't know how to host the websocket.

I've put it in the root directory of my MAMP localhost folder, and linked to it, like in the example code, at this path localhost:8181/websession.

Problem is the socket just fires the onclose event immediately. There's no call to the onerror function, so no error data.

  1. How do I run the C# Program on OS X?
  2. Where do I put the WebSocket?
Community
  • 1
  • 1
Kao
  • 2,242
  • 3
  • 22
  • 31
  • are you using [**SuperSocket**](http://supersocket.codeplex.com/)? If yes, they do nice [tutorials](http://supersocket.codeplex.com/documentation) and one of them is how to [host on OSX](http://supersocket.codeplex.com/wikipage?title=Run%20SuperSocket%20in%20Unix%2fLinux%20by%20Mono). – balexandre Sep 11 '12 at 12:46
  • No, I'm not. I'm trying to connect to my socket using html5 socket, but I don't have any programs helping me run it. I'll check it out though. Thanks. – Kao Sep 11 '12 at 12:50
  • But when you **`Run`** your website from Mono (the server) it does open a page right? your HTML5 client page just need to connect to that URL. – balexandre Sep 11 '12 at 12:59
  • The example websocket server you linked to is pretty old. It implements an obsolete draft of the protocol which no up-to-date browser will understand. I'd suggest you start by reading the [latest spec](http://tools.ietf.org/html/rfc6455) then update your handshake code. That should stop onclose running immediately on the client. – simonc Sep 11 '12 at 13:00
  • It runs, and alerts connection closed. – Kao Sep 11 '12 at 13:00
  • @simonc The link you posted, contains quite alot of text. Maybe you could point me in the right direction? – Kao Sep 11 '12 at 13:15
  • Start with the [handshaking section](http://tools.ietf.org/html/rfc6455#section-4.2). You could also take inspiration from [previous SO questions](http://stackoverflow.com/questions/10200910/create-hello-wold-websocket-example) – simonc Sep 11 '12 at 13:28
  • Thanks. Lots of reading to do I guess. :) – Kao Sep 11 '12 at 13:28

0 Answers0