WebSocket server list - html

I am looking to start a HTML5 WebSockets project and I was just wondering what you think the best back-end would be for that sort of thing? So far in my research I've stumbled across the following:
PHP Back-end (apparently a "Hack" and only compatible with Chrome and webkit nightlies)
Java Back-end (Seems well documented and cross-browser compatible)
Ruby Back-end (Don't know much about ruby, any opinions?)
JavaScript Library (Seems like it would be a nightmare, any opinions?)
Does anyone know of any other options or have an opinion on the above? My only requirements are ease of set-up and easy back end programmibility for bidirectional communication. I would essentially like to access a database through WebSockets and am looking for the easiest way to do this. Any feedback would be appreciated.

Ease of setup would have to be a hosted solution which uses WebSockets, HTTP Streaming or HTTP Long-Polling (one of which I work for). They're the easiest option because you don't need to spend time installing your solution, configuring it and working out how to use in when developing and in production.
If you are looking for a self hosted solution then it really depends on what technology you'd prefer to use and what the community for that technology is like.
Node.js and socket.io has a big community following at the moment so it wouldn't be a bad choice.
PHP - I'm afraid that PHP isn't really build with long-held persistent connections in mind. So, although there are options it's probably best to either use a hosted service or steer clear.
Ruby - check out Faye (also has node.js option), Juggernaut or Cramp
Java: As you say, jwebsocket or WaterSpout Server
Hope this helps.

I 'd recommend websocketd
http://websocketd.com/
It 's a thin layer you can wrap around any program that reads from stdin and writes to stdout and transform it to a websocket server.
So you can write in any language you like. Afterwards just
$ websocketd --port=8080 my-program
and you have your server.

Related

ESB servicemix Vs WSO2/synapse

I am searching for the best 100% open source ESB for the following requirements, after searching I'm confused between Servicemix and WSO2/synapse
1- The requester is mobile app that requires all services to be exposed via REST (JSON objects)
2- Many back end providers (JMS, SOAP, SMTP, LDAP, ...)
3- Provide easy way and flexibility to transform and perform complex business logic
4- Security and Caching
5- Above all easy to learn, use and extend with small learning curve and good tutorials and community support
Thanks,
I think you can achieve what you want with both of these. You might even want to look at the similar Mule ESB CE which is as well open source.
However, considering you want a flexible solution that is easy to learn, but not limited, then I would go for Service Mix and deploy various Camel routes to it. Camel is, imho, probably the easies and most well documented open source integration engines out there and I really recommend it.
In the end, it's a matter of taste. WSO2/synapse has it's base in web services, and you might feel better there if you are more comfortable with XML standards (including SOAP,BPEL..) than java programming (which is sort of needed in SMX/camel).

application design: Scala + HTML5

I'd like to implement an application with Scala and HTML5. My idea was to create a "local" client-server architecture: Scala handles the calculations and generates HTML5 as a GUI.
To my mind there are two possibilities
Use a Java/Scala framework that allows embedded HTML5. SWT for example has a browser widget. JavaFX seems good, too.
Distribute the program with a server and run it in a browser on localhost.
It would probably be most convenient to require an internet connection and forget about the localhost. Unfortunately an offline mode is necessary.
Now I would like to know how to get this right:
The first option seems easier to implement but I wonder: How can I communicate with Javascript without the HTTP protocol ?
The second approach was just an idea. Have you ever done something like this ?
If you've got advice or know a good framework please go ahead.
UPDATE :
I've just had an interesting idea: Could I use nodejs to create something like a server-server architecture ?
Right now the communication between Scala and Coffescript seems like the most problematic part. I still wonder how I could initiate an update from the Scala side of the application. A HTTP Request is a nice way to exchange data. Sadly to my knowledge in "standard" Coffeescript there would be no event hook to listen to server-side HTTP messages.
I've thought about using nodejs to listen to the server-sent data. Is this a good idea ?
With regards to the second option, you may wish to investigate the Play! Framework or Lift. They automate a lot of the work required to make a web application in Scala, including handling AJAX requests.
Although I haven't tried packaging either for local use, there was an earlier Stack Exchange question about packaging Lift which might be relevant. It should be possible with Play! as well.

Rails or node.js for Restful API

I have an existing website written in ASP.net, I have recently switched to Mac full time (With Windows in Boot Camp), and need to write a public API for accessing my website's MySQL data. I primarily want to use the API to allow building an iOS application.
I am interested in learning either Ruby on Rails or Node.js, I haven't used either of them yet.
Which language would be better for me to learn?
Rails is a relatively mature web framework based in Ruby and is designed for handling object-mapped data persistence in a relational database backend.
Node.js is much newer on the scene, and unlike Rails, is a more bare-bones package that allows for server-side Javascript applications thanks to a pretty tight HTTP(S) API. Node applications are by nature event-driven, which may or may not be ideal for your application.
Since it seems that you'll need data-persistence (you mentioned accessing MySQL data...), Rails might be easier to get started with, as it comes packaged with all the things you need in this respect and is designed to facilitate this sort of application.
If you you don't really need relational data persistence, Node is probably a better bet as it stays out of your way and lets you decide how to handle things. It's important to note that Node is a much more bare-bones "framework" than Rails -- if you want something slightly higher-level but still lighter than Rails that runs on Node, express is good place to start.
Still, if you want to try Node (I will confess: it's a lot of fun!), it's totally possible to access MySQL in a nice, event-driven (non-blocking) way. Here are two modules that will be helpful:
node-dbslayer
node-mysql
Neither is a language; they're frameworks. There is no "better", there may be a "more suitable" (probably not in this case).
Which would you prefer to develop in, Ruby (Rails), or JavaScript (node.js)?
Would you like to transfer that knowledge to a different job without rampup time (Rails)?
Would you like to learn something a bit more esoteric, event-driven (node.js)? (Ruby has Event Machine, but IMO node.js takes it a bit further.)
So this new application is just a middle man between your ASP.NET thing and your other clients.
In that case, totally use node. Node is great at being networking glue. Node scales great with IO bound applications (i.e. being a network middleman).
If you're going to use node then you probably want to look at express to make it easier.

Comet Chat in GoDaddy Linux Dedicated Server?

I want to know if it's possible to make my own chat application with ajax push.
And if it's, what is the easiest way to do it?
I know how to use javascript and make ajax calls but that's as far as I go. I can find tutorials myself but I can't tell whether the method is good or not so any links will be appreciated.
Thanks
to use ajax push (comet), you must make a server that will keep concurrent connections.
You can really do anything look for echo servers in your favorite language. Java/C/C++.. I'd do this in Java since it can run on Linux as well.
You can use http://www.ape-project.org/ which seems to be done already all for you.. but seems complex.. I'd recommend starting from scratch with a echo server.
I would recommend using Node.js as it is great at Comet/Ajax-push. Why is it great? Comet applications tend to be event driven and Node.js/javascript excels at these kinds of things.
However, if you prefer to do it in Java, Tomcat actually supports Comet as long as your servlet implements CometProcessor and you use NIO as your http connector. See http://tomcat.apache.org/tomcat-6.0-doc/aio.html

So I am looking for a good framework for my next web project

I don't like django. The forms, the url schemes, the way they assume everyone use models on schemaful db (I prefer to use mongodb because it's so clean and easy).
I am pretty much fluent in all the major languages. I do prefer python because it's very clean but also strict (aka function signatures requires you to pass in only X variables etc).
I want something developed and mature - this means that stuff like authentication, registration etc should all be developed and ready to use.
Any suggestions?
TLDR: Need new web dev framework. Requirement: Nothing. Preference: Mongodb, python.
By the way forgot to mention that I might be looking for employment in the web dev industry. So if you can recommend something that is common among big companies that would also be a bonus. like scala's lift for foursquare (if I am not wrong) and php for facebook.
Rails. It works with MongoDB via Mongoid and has many authentication solutions. You'll find Ruby very comfortable if you have Python experience.
I'm using Flask for Python, and I love it. I'm using SQLAlchemy for Postgre, but it's super minimalistic, so you can use it with whatever you'd like. I've also heard really good things about Pylons, but don't have any experience with it myself.
Spring Framework. (Java)
For authentication you can use Spring Security
It seems like you aren't very keen on using Java, but if you don't mind a different language on the JVM I'd suggest taking a look at Compojure, a web framework for Clojure. It isn't a scripting language but can offer close to the same development speeds once you get used to 'the-lisp-way' of doing things.
I'm unaware of a fully featured MongoDB interface specifically for Clojure, but CongoMongo and Adia (I can't include more than the one link currently so you'll need to google them yourself, sorry!) might have (atleast part of) what you're looking for. If nothing else, you could probably just use an existing Java library to access MongoDB or use a different database. Give Compojure a try though, its definitely productive!
Also on a completely unrelated note, this happens to be my first answer on SO, so please be gentle with the downvotes :)
Pylons.
It will be very fitting for you
Im a big believer in grails. Built on best of breed technologies like Spring and Hibernate, you can fall back to java if you have too. Takes all the pain out of more traditional Java EE development. Has all the important functionality as plugins, you have access to Spring Security, JMS, everything you need. Is very convenient as the back end to a RIA, easily render you models as json, easily handle xml. Its great.
EDIT -- to address the comment, Grails uses the Groovy language, which is scriptable and has some very groovy features. And it is easy to learn if you are familiar with java. Has closures, lots of syntactic sugar.
The scripting part is actually quite invaluable -- you write groovy scripts and import your grails classes to whip up functionality to augment your app (like quick queries into your db)