Web Sockets

23 views
Skip to first unread message

Alexander Makarenko

unread,
May 27, 2014, 1:22:20 PM5/27/14
to ironf...@googlegroups.com
Hello

I'm going to write a distributed system with a web sockets server included. In a demo console app I'm starting the server at ("ws://" + VCAP_APP_HOST+ ":" + VCAP_APP_PORT + "/").  This app is started with routing enabled inside the Iron Foundry but a client is not able to connect. Maybe web sockets protocol is not supported or should I specify uri in another way on client or server?

I can provide small test app if necessary.

Thanks,
Alex

Brian Button

unread,
May 27, 2014, 2:45:33 PM5/27/14
to ironf...@googlegroups.com
Alexander,

What we found when trying out an HttpListener to a console app is that we had to be careful about how we specified the VCAP_APP_HOST. Inside the warden code, we add a firewall rule like "netsh add http urlacl http://*:port", and our app couldn't communicate with the outside world without specifically listening on a URL that looked very much like this:

_listener.Prefixes.Add("http://*:" + port + "/");

Its possible that this could be the same issue you're facing. If you replace VCAP_APP_HOST with "ws://*:" and add the port to the end, it may start working.

I have a blog post on this exact issue coming out in the next couple of days.

bab



--
You received this message because you are subscribed to the Google Groups "Iron Foundry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ironfoundry...@googlegroups.com.
To post to this group, send email to ironf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ironfoundry/0edae077-5b3a-43cf-a26e-58b7f661b2aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Brian Button
Product Manager, Application Services
Tier 3/CenturyLink Cloud
@brianbuttonxp

Eric Lee

unread,
May 27, 2014, 7:07:11 PM5/27/14
to ironf...@googlegroups.com

What kind of client are you using?  It turns out that at the moment, CloudFoundry has a bug that prevents certain clients (Firefox and .Net Framework for sure) from successfully negotiating a WebSockets handshake.  The bug is described in detail at http://catdevrandom.me/blog/2014/05/12/hacking-on-cloud-foundrys-gorouter/.  It has not yet been fixed in the upstream CloudFoundry release, but as soon as it’s fixed there we’ll get it into IronFoundry.me.

 

Eric

Alexander Makarenko

unread,
May 28, 2014, 11:35:15 AM5/28/14
to ironf...@googlegroups.com
Hello 

Thanks Brian, yes I know about the Ivan's issue with the Http Listener. However ws://*:VCAP_APP_PORT doesn't allow to start the web socket app because of the "Instance failed to start accepting connections" health check. 

Thanks Eric, but my client sends acceptable Connection for the router but I have found my issue here https://www.pivotaltracker.com/n/projects/998274/stories/69963440 
Seems I have to start some workaround implementation.

It is not important but as I understand it is possible to specify the PORT via the manifest but in my test VCAP_APP_PORT is not equal to env:PORT. 

Thanks,
Alex 
Reply all
Reply to author
Forward
0 new messages