Saturday, August 18, 2012

Erlang Application with rebar

The basho guys did a great job for the erlang community for creating rebar which makes creating erlang/OTP applications easier. Rebar allows you to create apps, generate releases and upgrades all based on OTP standards.

1. Make sure you have erlang installed. Check out erlang website for instructions

2. Download rebar. I'd recommend the modified version by OJ available here

3. Extract the content to a folder. cd into that folder and run sudo ./bootstrap

4. You should get a build of rebar available in that folder. For easy access, copy the rebar file into your path, basically /usr/bin folder. Now we are ready to create our erlang app

5. Create a folder in your home directory e.g mkdir ~/sampleapp

6. Navigate into that folder cd ~/sampleapp

7. Run sudo rebar create-app appid=sampleapp. This will create the skeleton of our erlang app.

You can run make commands to compile and generate releases for your erlang app and don't forget to edit rebar.config to include dependencies.
You can read more on rebar and the available commands on the internet.

Cheers.

Friday, August 17, 2012

Twisting Erlang with Python

Lately, I have been thinking of developing a server partly in Erlang and Python (using twisted).
Erlang shines at managing processes whiles python is very good at IO stuff compared to Erlang.

This may be interesting. I will post about how it goes.

Wednesday, August 15, 2012

Amazon Load Balancer Setup for Websocket

Open your load balance settings on amazon and set port configuration to TCP forwarding

That should work.

Note that you can't get access to the client's IP address since the load balancer doesn't forward that to your websocket server.

Hope this helps