What is the current state of Web Sockets for Silverlight applications - silverlight

From what I've read Web Sockets holds more promise than the duplex polling that is currently available to Silverlight developers for receiving server notifications. However I'm not finding much written in the last 10 months, nor am I finding much at all from a Silverlight perspective.
Please don't answer, that Silverlight can open sockets. I know that --- howerver what I don't know is how silverlight can do that with its web server over port 80 in a firewall friendly way -- all of which is why I'm interested in Web Sockets.

The underlying Silverlight network stack won't allow port 80 to be connected to. The port restrictions are that the port must be between 4502-4534. See Network Security Access Restrictions in Silverlight.
Microsoft recently release a WebSockets prototype part of which includes a Silverlight WebSocket client. One additional restriction with the Microsoft Silverlight WebSocket prototype implementation is that a clientaccesspolicy.xml file must be served up from port 80 on the server that is being connected to.
The Super Websockets project also contains a Silverlight client somewhere. It will most probably have the same restrictions as the Microsoft implementation.

SL4 and 5 do not implement websockets. If browser used to host silverlight plugin supports websockets then you can use browser interop to call websockets api form the silverlight app.
Alternatively a trusted application can connect to any TCP port including port 80.

Related

is there any way to make remote desktop client using channel API GAE?

I have read about Remote Desktop Client with AngularJS and Yeoman.It is using sockets internally.
http://blog.mgechev.com/2014/02/08/remote-desktop-vnc-client-with-angularjs-and-yeoman/
As my angular app is deployed on GAE and I have implemented channel API for notifications. So is there any way to use channel API for the same?
Or any other best way to do the same?
The simple answer is: No, the approach documented by the provided link will not work on "normal" app engine.
Here a couple of reasons:
It uses a continuous socket connection to connect to the VNC server
It uses server sockets* to provide a stream to Yeoman VNC
The Channel API is not an appropriate replacement for sockets
*) App Engine doesn't allow you to open listening sockets. Having the 60 second / 10 minute deadlines in place it wouldn't be practical anyway (unless manually scaled and thus taking all the good out of app engine)
I just wrote an extended answer on a slightly similar question here. Some of the points there could be of interest to you.
Consider using App Engine Managed VM. I believe you can also run node.js application on managed vms.

websockets with mobile clients

Is is must to have the client to be browser for a web server? Is this a good architecture for mobile clients to have some non browser client and get data from webservers?
I am thinking of implementing a basic browser at mobile client. Login using web methos and rest of the communication (monitoring info at every 10sec) be done using web sockets. Will this work?
Can I implement web sockets without JS?
Thanks
You can implement WebSockets outside the browser, and without any JavaScript involved. You could have i.e. a Android native Java application that talks to a server over WebSockets.
WebSockets is a protocol. The WebSockets API defined for JavaScript running in the browser is something different.
You can authenticate a WebSockets connection during the WebSockets handshake using any method available with HTTP (i.e. basic auth, digest, cram-md5, client cert.-based (TLS), and so on), since the WebSockets handshake is still like any other HTTP conversation. It is only after the handshake is completed that WS is different from HTTP.
Note, that what you likely want on the server side is not a plain old Web server, but a WebSockets server/framework.
Whether using WS to connect mobile clients is "a good architecture" is a bit vague. I would say: if you decide to have your mobile client talk to a server, and that server is under your control, and you want to leverage WS advantages like near real-time/bidirectional, then it might be good. Better than cooking your own low-level protocol.

is it possible to use SocketClientAccessPolicyProtocol.Http while in development using Cassini

I have 3 projects in a Visual Studio 2010 solution. A Console App that is acting as my socket server, a Silverlight Client that would like to consume data from said socket server, and a Web project that hosts the Silverlight client and a clientaccesspolicy.xml file.
It seems to me that using SocketClientAccessPolicyProtocol.Http will not work as the Silverlight client would try and download the clientaccesspolicy.xml file over port 80 and not the port that Cassini is using for that debugging session.
I would rather not have to build a Policy Server, or more accurately, I would rather not have to open up port 943 in addition to 4502-4534 that I'm currently allowing.
Is it possible to use the Http option for retrieving the accesspolicyfile.xml in this case?

Connecting to device behind firewall

I have a wpf app that needs to communicate(exchange data) with a custom designed device (we can modify the code for the device). Do I have any options to connect to the device if it is behind a firewall via http? I was hoping there would be a method where the admin would not have to forward any specific ports or do anything on his end. I assume the issue is how would I address the device from my app. I know SOAP over SMTP is one option. Is another option where the device could chatter out to my application via http?
This problem is solved by relay services like Yaler or My-devices (I did not test this last one).
UPNP is supported by some firewalls to simplify this. Otherwise you are usually stuck opening ports on the firewall manually or using some 3rd party proxy server for a rendezvous server.
A lot of firewalls are setup to allow access on port 80 (HTTP) otherwise the users wouldn't be able to browse web sites on the internet. You can try and see if port 80 is open to traffic. If you can modify the code for both the device and the client you can use port 80 to communicate with your own protocol - you don't necessarily need to use HTTP.
Any kind of RESTful architecture over http will do it. If this is the best option for you depends on what APIs / libraries are available on your custom device.

Hosting ASP.NET Inside Silverlight

Yes, I know it is not the intention of Silverlight to host ASP.NET and that the namespaces/classes have been removed, but I have a small personal/pet project where Cassini-like hosting functionality (localhost only is fine) from within Silverlight would be a slick feature.
Can this be made to work somehow? What is missing?
You won't be able to do it because it's not possible to create a listening TCP socket. You can only create client TCP connections.

Resources