Questions tagged [mochiweb]

MochiWeb is an Erlang library for building lightweight HTTP servers.

MochiWeb is an Erlang library for building lightweight HTTP servers.

Getting started

  1. Download mochiweb from official repository on GitHub.
  2. Watch Video Tutorial To Start Developing Web Applications on Erlang.
  3. Ask questions.

Community

There's a group of users of mochiweb on Google, where you can find other useful info and talk to its developers.

70 questions
4
votes
1 answer

Long Polling in Mochiweb - How to tell if client aborts request?

I have a basic mochiweb polling loop that looks like the following, except it does other things instead of printing to the console and eventually returns: blah() -> io:format("Blah") blah() loop(Req) -> PathParts =…
Walt W
  • 3,261
  • 3
  • 30
  • 37
4
votes
3 answers

Erlang Facebook Example

Does anyone know of an example facebook app (or facebook connect app) done in Erlang? I'm looking for something that includes the whole process. Specifically I don't seem to find anything on user authentication. I've checked out erlang_facebook,…
werg
  • 49
  • 4
3
votes
0 answers

Someone can explain this erlang function call format: do(Param, {?MODULE,[a]})

example: -module(func). %% ==================================================================== %% API functions %% ==================================================================== -export([do/2]). do(Param, {?MODULE,[a]}) -> Param. Why…
Mark_H
  • 770
  • 1
  • 6
  • 19
3
votes
1 answer

Reading in Erlang the body of a HTTP request as it is received

I've been looking into Mochiweb, but I can't find a way to read the body while I'm receiving the request through the socket. I'm not limited to Mochiweb, any other HTTP library would be good for me. I also tried gen_tcp:listen(Port, [{packet,…
Ricardo
  • 1,778
  • 1
  • 19
  • 32
3
votes
3 answers

Git submodules and rebar

My application uses Mochiweb. As I understand, rebar fetches the latest version from Github when I run make, because there is a line in rebar.config: {deps, [ {mochiweb, ".*", {git, "git://github.com/mochi/mochiweb.git", "master"}} My…
skanatek
  • 5,133
  • 3
  • 47
  • 75
2
votes
1 answer

Erlang Design Advice regarding HTTP services

I'm new to Erlang but I would like to get started with an application which feels applicable to the technology due to the concurrency desires I have. This picture highlights what i want to do. http://imagebin.org/163917 Where messages are pulled…
Dave
  • 21
  • 1
2
votes
1 answer

how do we efficiently handle time related constraints on mnesia records?

i am writing records into mnesia which should be kept there only for an allowed time (24 hours). after 24 hours, before a user modifies part of them, the system should remove them automatically. forexample, a user is given free airtime (for voice…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
2
votes
2 answers

Erlang: How do I allow more than 1024 connection with Mochiweb?

I tried to increase file descriptors max limit on GNU/Linux: $ ulimit -n 999999 and I'm starting the server with -env ERL_MAX_PORTS 4096. Whenever I'm using test util, after 1012-1024 opened connection I'm getting the messages "Closed:…
HammerSpb
  • 725
  • 1
  • 12
  • 25
2
votes
1 answer

Emoji Encoding and Decoding erlang from list to binary

I want this string to be parsed for VOIP Notification for iOS to binary string: "{\"data\":{\"text\":\"❤️\"}}" I expected the data printed on the Erlang shell to be: <<"{\"data\":{\"text\":\"❤️\"}}">> But when printed it…
2
votes
3 answers

How to use application:get_env() in Erlang/OTP?

I created a mochiweb instance src/ |-- Makefile |-- room.erl |-- myserver.app |-- myserver.erl |-- myserver_app.erl |-- myserver_deps.erl |-- myserver_sup.erl |-- myserver_web.erl `-- uuid.erl in myserver_web.erl I am…
roder
  • 566
  • 6
  • 13
2
votes
2 answers

Mochiweb's Scalability Features

From all the articles I've read so far about Mochiweb, I've heard this over and over again that Mochiweb provides very good scalability. My question is, how exactly does Mochiweb get its scalability property? Is it from Erlang's inherent scalability…
ErJab
  • 6,056
  • 10
  • 42
  • 54
2
votes
1 answer

erlang webmachine not reading dispatch.conf

I'm working through an online tutorial on webmachine http://en.wikiversity.org/wiki/Web_Development_with_Webmachine_for_Erlang. I've downloaded the source from github, created a new application using /webmachine/scripts/new_webmachine.sh prp then…
2
votes
1 answer

Erlang Front-End Admin Panel

We're looking for a framework in which we can assign multiple roles to different users and allow those users to in turn manipulate certain data (based on their role). We have an ejabberd backend and a Mochiweb (BeepBeep framework) front end, and…
ewindsor
  • 885
  • 10
  • 24
2
votes
1 answer

OTP: how to supervise non-OTP components?

I am building an Erlang/OTP system which consists of a MochiWeb web server, some custom Erlang/OTP applications and a few non-native components, which are the following: a CouchDB database to store both the state of the MochiWeb web server and the…
skanatek
  • 5,133
  • 3
  • 47
  • 75
2
votes
2 answers

Parsing the result obtained from mochiweb_html

I would like to parse some content from an html file (no xml). At the moment I retrieve the structure to parse using mochiweb_html: 1> inets:start(). 2> {ok, {Status, Headers, Body}} = httpc:request("http://www.google.com"). 3> {String,…
user601836
  • 3,215
  • 4
  • 38
  • 48