• Stars
    star
    649
  • Rank 69,373 (Top 2 %)
  • Language
    Erlang
  • License
    Other
  • Created over 15 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Misultin (pronounced mee-sool-téen) is an Erlang library for building fast lightweight HTTP(S) servers, which also supports websockets.




Misultin development has been discontinued.

There currently are three main webserver libraries which basically do similar things:

Mochiweb has been around the block for a while and it's proven solid in production, I can only recommend it for all basic webserver needs you might have. Cowboy has a very interesting approach since it allows to use multiple TCP and UDP protocols on top of a common acceptor pool. It is a very modern approach, is very actively maintained and many projects are starting to be built around it.

Especially since the recent heavy development of Cowboy's HTTP server, I believe there is way too much duplication of efforts going on here. This is why Misultin's current 'state of the art' has been frozen in the latest tag, v0.9, to support all the companies currently using Misultin in their production environment. I'm here to provide help, if needed, in moving away from it. Thus, this server should be robust and stable enough to continue serving your needs for some time.

Instead of letting this library stand here without this notice, and getting developers still use this project, I have preferred to explicitly state to gradually move away from it, so that efforts can be concentrated around one server library only. It's hard enough to let one 'child' like this one go, but I believe it's best for the whole Erlang community.

Thank you to everyone that has been supporting Misultin in these years. Hopefully its code usability, which I still believe to be unmatched (well, I have developed it so how could I feel differently about this ^^_), will provide inspiration for some library interfaces.

Best to you all,

r.





MISULTIN

Misultin is an HTTP(S) library which can easily be embedded in your own application.

https://github.com/ostinelli/misultin

>-|-|-(°>

Features

  • Very fast
  • HTTP and HTTPS
  • Supports multiple Websocket protocols (draft-hixie-68, draft-hixie-76, draft-hybi-10 and draft-hybi-17)
  • Cookies
  • Session Variables
  • Allows for Chunked and Byte streaming responses
  • Allows for streaming file upload (via Chunked Encoding)
  • Can serves static files from a static directory (though in production you should consider a specific server such as nginx to do so)
  • Has Many customization options (maximum allowed connections, maximum body size, ...)
  • Has a callback function for your logging needs
  • Supports Unicode
  • Can start multiple servers on a single node
  • Can be used with or without Parametrized Modules
  • Can traps the client closing a browser in Comet applications
  • It's very easy to use

Quick Start

The typical 'Hello World" example code is:

-module(misultin_hello_world).
-export([start/0, stop/0]).

% start misultin http server
start() ->
    misultin:start_link([{port, 8080}, {loop, fun(Req) -> handle_http(Req) end}]).

% stop misultin
stop() ->
    misultin:stop().

% callback on request received
handle_http(Req) ->
    Req:ok("Hello World.").

Issuing the start/0 command will start an HTTP server on port 8080, which will respond to every request with an "Hello World" text.

Examples

Misultin comes packed with examples.

Simple Examples

Websockets

Comets

More Advanced

Module Exports

The complete list of module exports can be found here.

Parametrized modules

Some developers hate them, some love them. Misultin allows you to choose if you want to use them or not. The same Hello World example shown here above, but without parametrized modules, looks like this:

-module(misultin_hello_world).
-export([start/0, stop/0]).

% start misultin http server
start() ->
    misultin:start_link([{port, 8080}, {loop, fun(Req) -> handle_http(Req) end}]).

% stop misultin
stop() ->
    misultin:stop().

% callback on request received
handle_http(Req) ->
    misultin_req:ok("Hello World.", Req).

Dependencies

You will need:

Under the hood

Misultin is built using the OTP principles. When you start it using the misultin:start_link/1 command, you are actually starting a supervisor which handles all of Misultin's servers and modules.

Therefore, in real life applications you should always embed it in your own application. An easy example on how this can be done can be found in the Application Example here.

SSL Notes

If you are running misultin behind an SSL terminator such as stunnel or stud, and are using websockets, to make the websocket handshakes work, set in the starting options:

{ws_force_ssl, true} 

If you are using stunnel to terminate, to make misultin expect a PROXY.. line as per the proxy protocol you can also set in the starting options:

{proxy_protocol, true}

Newer versions of stunnel support this with the "protocol = proxy" config option.

More Repositories

1

syn

A scalable global Process Registry and Process Group manager for Erlang and Elixir.
Erlang
622
star
2

apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
Ruby
477
star
3

gin

A LUA fast, low-latency, low-memory footprint, web JSON-API framework with Test Driven Development helpers and patterns.
Lua
238
star
4

SublimErl

An Erlang Plugin for Sublime Text 2, which enables code completion and allows you to run tests within the editor itself.
Python
190
star
5

net-http2

NetHttp2 is an HTTP/2 client for Ruby.
Ruby
140
star
6

ram

A distributed KV store for Erlang and Elixir.
Erlang
119
star
7

pgpool

A PosgreSQL client that automatically uses connection pools and handles reconnections in case of errors.
Erlang
42
star
8

cowbell

An Erlang node connection manager.
Erlang
26
star
9

erlcassa

A Cassandra CQL client.
Erlang
18
star
10

bisbino

An Erlang HTTP server with FastCGI as backend.
Erlang
18
star
11

rebar3_vendor

Rebar3 Vendor Plugin.
Erlang
14
star
12

SCAR_UCM

Utilities Construction Mod for Arma 3.
SQF
11
star
13

PyAES256

An AES-256 cryptographic module for Python.
C
9
star
14

erlgate

An alternative transport for Erlang messages across nodes.
Erlang
8
star
15

lager_airbrake

An Airbrake lager backend.
Erlang
7
star
16

gin-demo

The working demo code of the Gin tutorial on gin.io.
Lua
4
star
17

origami

My standard bootstrap project for distributed TCP applications.
Erlang
3
star
18

SCAR_E2TB

A mod for Arma 3 that allows you to export data to Terrain Builder, from EDEN and in game.
SQF
3
star
19

phpass

A simple implementation of PHPass’ Portable Hash.
Erlang
3
star
20

mochiweb_reloader

Erlang
2
star
21

contextual-git-prompt

Display git information in OSX terminal's prompt.
Shell
2
star
22

pyopenspime

Automatically exported from code.google.com/p/pyopenspime
Python
2
star