Websockets in Flash - html

Two connected qustions
I understand that non HTML5 browser can connect to websockets using flash.
https://github.com/gimite/web-socket-js
1. However is there an implementation of websockets for flash inside flash?
2. If I were to use normal flash sockets, would the sockets work if there were multiple instances of the flash file running on a local network connecting to an external socket server. Would the messages intended for one instance be forwarded to all instances

Here is a Flash implementation for use in Flash itself: https://github.com/y8/websocket-as
I'm not sure what you are asking but it sounds more like a question about the WebSockets server application and that completely depends on your application.

Related

OSC communication in flash-flosc vs TUIO

I have an AIR app that need to communicate via OSC with a remote server.
I'm somewhat confused by the differences between this 'Flosc' AS3 library
https://code.google.com/p/flosc/
and TUIO AS3
https://code.google.com/p/tuio-as3/
since they both allow OSC communication.
Can anyone shed some light on this? Is TUIOAs3 simply more powerful?
I see the last updates have been around 2011 on both.
I think FLOSC is slighly older and relies on running a UDP Server for OSC connectivity which then is bridged to as3 via the Socket class(which is TCP)
This bridge is the java application available on the FLOSC repository download list. On OSX they recommend Memo's udp-tcp-bridge.
tuio-as3 includes OSC support which you need and the nice thing about it is that it can also make use of AIR's udp functionality, so you won't need the java or c++ UDP to TCP Bridge.(the simpler the better, you'll have to worry about 2 apps being configured properly, not 3 as you would with FLOSC)
I'd recommend tuio-as3 if you're not sure, especially since you already have a basic as3 example from last year (which I hope was helpful).

Use of RFB or RDP for a single GUI application

I’d like to be able to create a GUI that can be viewed over the network by a remote client.
One approach is to code the whole GUI in HTML5 and run it from a server such as Apache; the main difficulty with this is that the GUI includes at least one, sometimes two, windows containing live video streams (without any sound) and there doesn’t seem to be a good way of streaming live video into HTML5 - especially as it really needs to be live; a few seconds’ latency would be unacceptable.
Another approach (which I’ve done already, and actually works pretty well) is just to code the GUI as a desktop application (for example using Qt), and then to view the desktop remotely using VNC or Windows Remote Desktop. This gives the required responsiveness and lack-of-latency, but has the disadvantage that the whole OS desktop is accessible and not just my one application.
So, here is my question: is there a mechanism or a framework available that would enable me to use RFB (i.e. the protocol underlying VNC) or RDP (that underlying Windows Remote Desktop) to provide remote access to a single GUI application rather than a whole desktop?
When we comparing RDP and RFB the main deference is RDP only share metadata where RBF share whole frame buffer of the screen. So RBF is slow than RDP. VNC is using RFB where windows applications like Lync using RDP.
http://sandaruwmp.blogspot.com/2014/05/remote-desktop-application-with-rdp.html Here you can see a simple RDP example
Actually you can create an application that only shares a single application and also you can use many other protocols with RDP
here https://github.com/sandaru/RDAPP in this application it uses RDP with TCP that you can select only one application to show.
In this application it shares the desktop via RDP and listen to a TCP port you can send commands such as "stop selected processes", "Focus single application" and "share whole window". RDP react according to the TCP requests.
i hope this will be useful for you
NOTE: Above Source does not contain any NAT traverse mechanism.

Unix: Keeping an instance of flash player running as a daemon...?

I'm pretty new to unix operating systems. I'm running CentOS 6.5, and I need to run 1 (or more ideally) instances of Flash Player continually in the background, I've no idea how to do this.
The reason is because in Flash I'm using the RTMFP protocol to send data between clients P2P, and it would be useful for me to have a few test clients running on my server all the time.
How would I go about doing this? The flash program needs to be visually navigated through its menus to get it into the state required. Currently I'm just using putty, what can I install to get a GUI to do this, and how might I go about getting Flash Player (10.1 up) to work?
Thanks a lot!
I think I have an idea what you're trying to do. To clarify, you want to have several flash applications running in browsers or via a flash player to act as test users to test your RTMFP protocol?
If this is the case, use VNC (something like running multiple instances of x11vnc on different ports) to log into several GUI accounts on your system and run the application (Linux is multiuser by default). You can close out the VNC without ending your session. This should work for what I think you're trying to do.
Hope this helps.

With Native Client (NaCl) is it possible to embed a server in a page that can accept incoming requests?

Is it possible to open a port using Native Client that other browsers can connect to? Like a browser to browser connection?
In general, no. NaCl does not allow programs to open sockets directly (that would be a security problem). It is intended that NaCl/Pepper applications have the same general capabilities as Javascript applications; so something like WebSockets (connection back to the server) would be supported, but not directly opening files or sockets on the client machine. There's some work going on to have a P2P style networking in HTML5 (e.g. http://www.w3.org/TR/2008/WD-html5-20080122/#peer-to-peer) which would likely get Pepper support as well, but I don't know what the status of that is.
The only way to get P2P connection in browser is through WebRTC. If NaCl allows to use WebRTC (though Pepper API or whatever) then the only thing you need besides implementation is broker server that will connect clients with each other. See PeerJS for some info.

Connecting a socket through a Proxy in ActionScript 3

1) How would I connect through a proxy if I am using the Socket class to connect to a server?
2) If I am running my Flex application through Flash Player in a webbrowser and my webbrowser is configured to use a proxy, does the socket connection go through the proxy automatically?
Ideally, I would like to not have to depend on the web browser's settings, and be able to programmatically proxy the connection from my own code. By supporting proxies directly, I can compile it as a desktop AIR application and still support proxying the connection. Additionally, there may be cases where more than one socket connection will need to be created to different proxies.
Using Action Script 3 in Flex Builder 3.
Thanks.
You may not be able to do this with the vanilla Socket class, but check out this post by Christian Cantrell of Adobe (Google cache version) about a specialized socket class he wrote to allow "TCP socket connections through HTTP proxies in accordance with RFC 2817". His class, the winningly-named RFC2817Socket.as (github), is used by Open Flash Chart. As Christian notes in his post, there are some caveats and it may not work for you if your server doesn't support RFC 2817, or if there are certain other conditions which aren't met.
Note that on Windows, the Flash Player uses IE's proxy settings and ignores the settings of the actual browser you're using.
I've had a look and it doesn't seem possible to do exactly what you want to do. If you have control of a server you can route requests through a server yourself ... and Adobe has examples of this using their Flex Data Access services (BlazeDS and LiveCycle) to go through a proxy. Then again if you control your own server you can get it to proxy anyway you like ...
But I'm afraid there doesn't seem to be anyway to directly set a proxy on the client side using ActionScript.
As for Flash respecting the browsers proxy, I can't say I know from first-hand experience but the evidence from searching isn't good. Here is an article that claims flash won't use your browsers proxy setting for SOCKS on Linux and suggests you need to alter your iptables. There is also this adobe bug report suggesting it doesn't work for rtmp connections at least. Other anecdotal evidence suggests that it works sometimes (for HTTP requests) for some browsers.
So if you need to guarantee that a connection goes through a proxy it looks like you'll need to route your requests through a server and proxy from there.
You can't do that with a regular HTTP or SOCKS proxy. Flex shares browser's connection settings.
But you still can bypass that by using what they call PHP Proxy, basically a website which downloads another websites and forwards the result to you.