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
1
vote
1 answer

How to enable active sockets in a Mochiweb application?

Does anyone know how to enable active instead of passive sockets in a Mochiweb application. Specifically, I am trying to adapt http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-2 so that when a client disconnects,…
Shayne
  • 11
  • 1
1
vote
1 answer

Is there any State variable in Mochiweb?

I have skimmed through the Mochiweb code, but have not found any sign of the State variable. Does something similar to gen_server's State variable exist in Mochiweb? I need to store some small amount of state-related server-side (not…
skanatek
  • 5,133
  • 3
  • 47
  • 75
1
vote
1 answer

Is Snappy compression appropriate for Mochiweb, HTTP compression?

I am using Snappy (https://github.com/fdmanana/snappy-erlang-nif) as a zlib replacement for HTTP compression on a Mochiweb application. While Snappy works in general for me, and zlib works fine for compressing responses before sending them out,…
Jr0
  • 2,131
  • 13
  • 23
1
vote
1 answer

erlang error_logger handler disappeared unexpectly

I have a mochiweb based application. I specified -kernel error_logger '{file, "mylog.log"}' while starting the application, after running for a while, error_logger won't output anything. When the application…
tewilove
  • 41
  • 1
1
vote
1 answer

An error with Erlang router

I try to make a comet-server using Mochiweb like there. If I do it from erlang shell, it's alright. But If try to start 1st node with mochiweb from command line: erl -pa ebin edit deps/*/ebin -boot start_sasl -sname n1 -s server +K true -setcookie…
Ardem
  • 11
  • 2
0
votes
1 answer

Does mochiweb can play m3u8 stream?

I use lighttpd to play http live stream, it works well. I want to use mochiweb to play it in order for high performance, is it feasible ?
why
  • 23,923
  • 29
  • 97
  • 142
0
votes
2 answers

Destroying a Data Structure when program doesnot need it anymore -- Erlang

Certain functions that manipulate Tuples in Erlang, result into copies of new tuples after the operation. In most cases, the program is no longer interested in the old tuple copy from which a new one was made. lets look at an…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
0
votes
1 answer

How does one set the auto-logout time in mochiweb?

I'm looking at the source code for mochiweb and seeing numbers that test cookie expiration time that look nothing like the behavior of the server that I've inherited. mochiweb has 111 and 86417 (a day plus 17 seconds) in source, but it looks like…
Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
0
votes
0 answers

Couchdb SSL failing with "bad record mac"

I am seeing the following in my couchdb "2.3.1" log file on a new ubuntu machine I am building. All other couchdb operations on the same machine seem fine. [error] 2023-03-14T09:36:00.840088Z nonode@nohost <0.3181.718> -------- application:…
ferg
  • 196
  • 1
  • 11
0
votes
1 answer

non-http in mochiweb

I am using mochiweb for a server that may also get a TCP connction to which the client sends a simple string (without a newline, the string is not http). Mochiweb uses HTTP sockets and therefore fails to detect this (i dont even get http_error that…
user650842
  • 81
  • 5
0
votes
2 answers

function_clause error in Couchdb 1.1.0 after updating from 1.0.1

I have errors when updating document in Couchdb 1.1.0 after updating it from 1.0.1 Response looks like this: stdClass Object ( [error] => unknown_error [reason] => function_clause ) When i was using 1.0.1 everything was ok. There's something in…
Dmitrii Sorin
  • 3,855
  • 4
  • 31
  • 40
0
votes
3 answers

Erlang/Mochiweb newbie question abt clients communication

Everytime the client/browser connects to Mochiweb server, it creates new process of Loop, doesn't it? So, if I want to transfer a message from one client to another (typical chat system) I should use the self() of Loop to store all connected clients…
moriesta
  • 1,170
  • 4
  • 19
  • 38
0
votes
1 answer

Streaming Results from Mochiweb

I have written a web-service using Erlang and Mochiweb. The web service returns a lot of results and takes some time to finish the computation. I'd like to return results as soon as the program finds it, instead of returning them when it found them…
Alex
  • 385
  • 2
  • 11
0
votes
1 answer

mochiweb: disable headers ordering

I checked mochiweb response headers, and they are always ordered (descending): < Server: MochiWeb/1.0 (Any of you quaids got a smint?) < last-modified: Sun, 30 Aug 2015 23:13:04 GMT < Date: Sun, 30 Aug 2015 23:15:15 GMT < Content-Type: text/html <…
eLRuLL
  • 18,488
  • 9
  • 73
  • 99
0
votes
2 answers

Algorithm not counting the size of images using mochiweb parser

I am trying to make this https://ppolv.wordpress.com/2008/05/09/fun-with-mochiwebs-html-parser-and-xpath/ algorithm work. So everything is compiling and working pretty good (I am getting the size of html page) but: What I expected: Size of html Size…
Marcin Majewski
  • 1,007
  • 1
  • 15
  • 30