Development on Various Platforms
12.1K views | +0 today
Follow
Development on Various Platforms
Your new post is loading...
Your new post is loading...
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Atmosphere and AngularJS

Atmosphere and AngularJS | Development on Various Platforms | Scoop.it

Atmosphere framework is the The Asynchronous WebSocket/Comet Framework for building asynchronous web applications.

You code your asynchronous web application using one codebase and deploy it on any Servlet container or straight to the cloud. There's no need to think about WebSocket support or hardcode specific vendor implementations.

Sounds too good to be true, doesn't it? Let me show you that it is true, indeed.

The tutorial is based on the excellent example from the Atmosphere examples project and modified to use AngularJS for the front end.

Let's analyze requirement more thoroughly.

* There must be a front-end allowing user to submit the name.

* There must be a way to connect and listen for the incoming messages asynchronously from the front end.

* The server must asynchronously process incoming chat messages and notify all users in the chat.

As it will become clear after completion of this tutorial, Atmospheres framework makes it incredibly easy to deal with the server side asynchronous processing. You'll find that most of time you are spending building nice front-ends instead of dealing with complexities of asynchronous request processing.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Building Multiplayer Games with Node.js and Socket.IO

Building Multiplayer Games with Node.js and Socket.IO | Development on Various Platforms | Scoop.it

With the release of the Ouya, Xbox One and PS4 this year, couch-based console gaming appears to be as popular as ever. Despite the proliferation of multi-player games available on mobile devices, and even the advent of multi-player experiences available on the web, sitting next to the person you’re playing a game with is still an irreplaceable experience. While experimenting with Node.js and the Socket.IO library, I found a perfect opportunity to not only learn some interesting new technologies, but also experiment with using the web and common devices (computers and mobile phones) to replicate a console-like gaming experience.

This article will give a brief overview of the fundamental concepts of the Socket.IO library in the context of building a multi-player, multi-screen word game. A web browser on a large screen device, such as a TV or computer will be the ‘console’ and mobile browsers will act as the ‘controllers’. Socket.IO and Node.js will provide the necessary wiring for all the browsers to share data and provide a cohesive, real-time game experience.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

BinaryJS - Realtime binary streaming for the web using websockets

BinaryJS - Realtime binary streaming for the web using websockets | Development on Various Platforms | Scoop.it

BinaryJS is a lightweight framework that utilizes websockets to send, stream, and pipe binary data bidirectionally between browser javascript and Node.js.

* BinaryPack serialization format is fast, binary, and JSON-type compatible. Data stays binary end to end
* Automatically chunks large binary data buffers for streaming performance
* Send multiple streams of data concurrently over multiplexed websocket connection
* API implements Node.js read/write Streams. You can pipe any stream into BinaryJS streams (and vice-versa)
* "pause," "resume," and "end" as in the Streams API


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Angular.js example application

Angular.js example application | Development on Various Platforms | Scoop.it

This article is my first one for quite a while, there is a reason for that but I will not bore you all with that. Anyway I have written this article after a little time off. So what does it do, what is this article about?

I decided to spend a bit of time to learn a bit more about a popular web MVC framework by our friends at Google called Angular.js, which is a JavaScript MVC framework, which is a bit of departure for me from my usual XAML influenced world. It is however good to try things out to get an appreciation of how you would do things in different languages/environments (my old mentor Fredrik Bornander (AKA the Swede) told me that), so I decided to take Angular.js for a spin.

This article will talk about some of the fundamental ideas behind Angular.js, and shall then focus on the specifics of the demo application that I have created to go along with this article.

Before we get into the actual article I will just breifly (not too techie just yet, though I know you lot will want to see that, and it will come don't worry) talk about what the demo app does in plain terms, so you know how to drive the thing yourself when you download it.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Testing Security of HTML5 WebSockets

Recently I became faced with my first Web Application Security Assessment which relied heavily on HTML5′s WebSockets.

The first clue that the application was using WebSockets was when the application kept giving me a timeout error while using my proxy of choice, Burp Suite. Looking at the HTTP requests/responses in Burp I noticed that a large JavaScript file was requested and downloaded from the server. Within this file I noticed a URL with the ws:// scheme, the WebSocket scheme.

For some reason the WebSocket handshake was not captured by Burp’s Proxy (even though the WireShark capture shows that the handshake was over HTTP), however, it can be viewed within Google Chrome’s Developer Tools and OWASP’s ZAP Proxy.


* Encryption (SSL/TLS)
* Origin
* Authentication
* Authorisation
* Input Sanitisation

 


Via Jan Hesse
more...
Benjamin Dean's curator insight, September 3, 2013 1:13 AM

As web apps move to be more "real-time" via socket connections, this is probably a good discussion.

Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

HTML5 Real-Time Chat with Websockets, jQuery, and Spike-Engine - CodeProject

HTML5 Real-Time Chat with Websockets, jQuery, and Spike-Engine - CodeProject | Development on Various Platforms | Scoop.it

MyChat: a simple real-time client-server chat using fancy HTML5 features and identicons.

Everything in the web becomes increasingly real-time and HTML5 finally offers some facilities to build efficient, simple and robust real-time applications on the web. This article serves as a demonstration of such facilities in building a fun and simple client-server chat: 

It uses websockets internally, but abstracted by Spike-Engine, will fallback to flash sockets for older browsers.It uses HTML5 Data URI for rendering images streamed from the server as byte arrays.It uses custom fonts and jQuery for animated rendering.It is cross-platform and with a minimized packet payload and message compression.The application server is a self-hosted executable and the client is just a plain html file.

First of all, we need to define a communication protocol between. This represents the messages which are exchanged between the client and the server. Spike-Engine simplifies the networking implementation and allows expressing this protocol declaratively via an XML file. This part is quite straightforward, check the user guide on their website for more info. 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Polling, Long Polling, Comet, Server-sent Events (SSE), and WebSockets

I've been asked about these concepts multiple times. Not being known for the most concise and easily understood explanations, I thought this would be an apt opportunity for sharpening my Yoda.

Challenge: provide the best explanation, to a software engineer with little understanding of HTTP, for Polling, Long Polling, Comet, Server-sent Events (SSE), and WebSockets. 

But ofcourse you're free to skip sections you're familiar with. However, if you're new to all this, then I really do think that you should just pucker up and read it all.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Create a Multi-user Presentation with Reveal.js

Create a Multi-user Presentation with Reveal.js | Development on Various Platforms | Scoop.it

Creating impressive presentation is an art. For a long time PowerPoint stood alone as the de facto tool for creating presentations.

 

Now, things have changed, as the web has become the focal point for all businesses, and as browser capabilities improved tremendously. Modern browsers are now capable of rendering 3-D graphics and animations just like in any other native applications.

 

Then there came some cool presentation libraries based on HTML5 and CSS3. Reveal.js is a highly popular library for creating stunning presentations.

 

Websockets is a new standard defined as a part of HTML5 spec, which enables bi-directional, full-duplex communication in browsers. There are number of JavaScript libraries that make working with Websockets easier, of which Socket.IO is a prominent one.

 

In this article we’ll discuss how to create a Reveal.js presentation that can be controlled by multiple users. We’ll make use of Socket.IO for sending and receiving slide change events in real-time. Reveal.js already comes with a multiplexer plugin, but this is a bit difficult to set up so we’ll ignore that for the time being. Let’s focus on how we can write a Socket.IO server that’ll suit our purpose.


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Request-Response oriented Websockets

Request-Response oriented Websockets | Development on Various Platforms | Scoop.it

The nature of websockets allow realtime data transfer between two peers in “realtime”. This mechanism is perfect for exchanging events without relation to each other. But what if you want to ask your peer for some specific response and wait until this particular response arrives?

This pattern is well-known under the name Request-Reply or Request-Response and builds the basis for todays HTTP communication on the web. Following JavaScript code shows how the Node.JS API implements this pattern to request some HTTP response from a webserver:

As soon as a response is available, the callback function armed with the response object gets executed and the awaited data is processed.

Using websockets, you do not have this mechanism built-in since there is not really a response which has to follow on a request. More precisely, there is not even a thing called request: You exchange data with no relation to each other.

Primus Responder resolves this situation while being a plugin for the realtime communication wrapper Primus. It allows to request the opposite peer for a response using a simple API known from other libraries.

 


Via Jan Hesse
more...
No comment yet.
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

VNC client on 200 lines of JavaScript

VNC client on 200 lines of JavaScript | Development on Various Platforms | Scoop.it

In this quick blog post I’ll show you how to create a simple VNC client in about 200 lines of JavaScript.
For our goal we’re going to use only HTML5 and JavaScript (client and server side).

Our application will have very simple architecture – a proxy server written in Node.js and a client in HTML5 and JavaScript. The Node.js server will stay between the browser and the VNC server. We need it because the client-side JavaScript does not supports TCP sockets so we can’t connect directly to the VNC server. The HTML5 client will have a canvas on which we will draw the frames we receive from the server.
For VNC server you can use the free version of RealVNC.

First lets start with the server. Make sure you have node.js installed. We will use four node modules: rfb2, connect, socket.io and node-png.

 


Via Jan Hesse
more...
AoJ's comment, September 1, 2013 5:18 PM
wau
Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

Node.js: Creating a Bi-directional RPC Stream over a Websocket

Node.js: Creating a Bi-directional RPC Stream over a Websocket | Development on Various Platforms | Scoop.it

For many years, the Remote Procedure Call (RPC) has been one of the most used means of making nodes talk to each other. In RPC there are two intervenients: the server, which hosts a series of procedures, and a client, which calls these procedures. In most RPC implementations, the client calls these procedures as if it was doing local calls, making the code look natural.

In Node.js with the browser you can use this module named rpc-stream to create a RPC channel between a server and a client. You can also make two of these channels on top of a duplex channel (like a sock.js websocket stream) to make the calls bi-directional: not only can the browser invoke procedures on the server, the server can also invoke procedures on the client by its own initiative.

In this post, we’re going to take the To-do application example we built in the previous post and modify it so that it uses an RPC Stream instead of an Event Stream.


Via Jan Hesse
more...
Simon Hunanyan's curator insight, August 31, 2013 2:49 AM

SocketStream is a new breed of web framework that uses websockets to push data to the browser in 'realtime'. It makes it easy to create blazing-fast, rich interfaces which behave more like desktop apps than traditional web apps of the past.

Rescooped by Ertunç Efeoğlu from JavaScript for Line of Business Applications
Scoop.it!

HTML5 WebSockets (Test WebSocket For Client/server)

HTML5 WebSockets (Test WebSocket For Client/server) | Development on Various Platforms | Scoop.it
As you learn about HTML5 WebSockets in my previous article which is introduction article here in this article we will going to test the websockets.

Via Jan Hesse
more...
No comment yet.