Questions tagged [yaws]

Yaws is a high perfomance HTTP 1.1 webserver particularly well suited for dynamic-content web applications.

Yaws is a high performance HTTP 1.1 web server particularly well suited for dynamic-content web applications. Two separate modes of operation are supported:

  • Standalone mode where Yaws runs as a regular web server daemon. This is the default mode.
  • Embedded mode where Yaws runs as an embedded web server in another Erlang application.

Yaws is entirely written in Erlang, and furthermore it is a multi-threaded web server where one Erlang lightweight process is used to handle each client.

The main advantages of Yaws compared to other Web technologies are performance and elegance. The performance comes from the underlying Erlang system and its ability to handle concurrent processes in an efficient way. Its elegance comes from Erlang as well. Web applications don't have to be written in ugly ad hoc languages.

See more: https://github.com/erlyaws/yaws

193 questions
2
votes
2 answers

Routing in Yaws

How can one do routing in Yaws? Like routing in ASP.NET MVC or Rails. Of-course Erlang is a functional language without notions from oo world; but one could rout http://[domain].[com]/controller/action/arg1/arg2/ as a GET request to a module named…
Kaveh Shahbazian
  • 13,088
  • 13
  • 80
  • 139
2
votes
3 answers

How do I disable debug checks in yaws?

When i start yaws (yaws -i --conf config/yaws.conf) i get this line in the output: Running with debug checks turned on (slower server) It depends on the "-i" option? Or where did i turned on debug checks? No mention of debug in the config…
2
votes
2 answers

Yaws process died: {{badmatch,<<>>}

I'm going over a very basic erlang book while using yaws. I'm editing a single yaws file and refreshing the browser. Often (3rd time now) the process will just start to show this error. and i look and look for a syntax error or anything, and…
gcb
  • 13,901
  • 7
  • 67
  • 92
2
votes
1 answer

How YAWS handle concurrent users

I wish to know which code is being executed in YAWS every time a new client uses its web server... First I tried to understand how YAWS handles concurrent users... and trie the following .yaws page: io:format("~nProcess Identifier: ~p Port: ~p …
cgval
  • 1,096
  • 5
  • 14
  • 31
2
votes
2 answers

Erlang and SOAP services - A rock and a hard place

My question may first of all seem to have a duplicate but i have hit something that has suprised me. Yaws Webserver comes with a complete set SOAP example, but when i tried running it as is, this is what i get: In text form, this is what i see in…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
2
votes
1 answer

How to handle multiple requests to out(A) in yaws?

Recently, I have startet working on a REST api in erlang & Yaws. I don't understand how yaws & my module handle multiple requests. I do have api module gathering all requests : appmods = and my test module : -module(api). out(_Arg) -> …
Ginaf
  • 23
  • 2
2
votes
1 answer

Setting content header for file download in Nitrogen webserver

I am dynamically generating a file on Nitrogen Webserver and want the browser to show the name of file in download dialog. Currently I am setting something like this - wf:content_type("application/x-download") This enables the browser to ask for…
spkhaira
  • 821
  • 7
  • 18
2
votes
1 answer

Yaws Sample Files

I am currently trying to understand and find case studies for web pages using YAWS. Apart from the default ones that come with the sources, anyone knows of any sample pages that I can find? Thanks,
cgval
  • 1,096
  • 5
  • 14
  • 31
2
votes
1 answer

Mnesia Replication and Large Numbers of Dirty Operations

Some applications require really fast response, to meet their expectations to users. I am building one such application and i am using mnesia. Now, when we by-pass the mnesia transaction manager , we approach good performance. However, this is the…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
2
votes
1 answer

Using Yaws and websockets to subscribe to data

I have a gen_server speaking to several hardware sensors. This setup works fine. Now I want to extend this system with a real time visualization of the data. And I want to deliver this data to a web client over websockets. As I might have several…
Magnus Kronqvist
  • 1,559
  • 12
  • 22
2
votes
2 answers

Mnesia Query Cursors - Working with them in Practical applications

In most applications, its hard to avoid the need to query large amounts of information which a user wants to browse through. This is what led me to cursors. With mnesia, cursors are implemented using qlc:cursor/1 or qlc:cursor/2. After working with…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
2
votes
2 answers

Erlang and Yaws setup on MacOS X

I'm trying to run Yaws 1.94 on my Mac OS X 10.8 and it crashes. I'm running Erlang R15B01 I am using macports to install this with the commands: sudo port selfupdate sudo port install erlang +ssl yaws export ERL_LIBS=/opt/local/lib/yaws/ sudo…
bibekp
  • 101
  • 1
  • 5
1
vote
2 answers

How to set cookies with yaws

Is there function like php setcookie . If not then how? EDITED: yaws_api:setcookie("lang","lang_value", "/"), yaws_api:find_cookie_val("lang", (A#arg.headers)#headers.cookie), find_cookie_val returns empty string because setcookie didnt set…
Yola
  • 18,496
  • 11
  • 65
  • 106
1
vote
1 answer

How do I handle a WebSocket close from the client in Yaws?

I have implemented a simple appmod that handle WebSockets and echo back the messages. But how do I handle an ws.close(); from the JavaScript client? I have tried with the code below, but handle_message({close, Reason}) is never called and ws.onclose…
Jonas
  • 121,568
  • 97
  • 310
  • 388
1
vote
1 answer

How to use c++ module with yaws

I don't have experience in using c++ with apache or other web server. But now want to use it with yaws to generate pdf from passed data. May be somebody has experience in doing so. Please any link. I havent found any. May be better to not use…
Yola
  • 18,496
  • 11
  • 65
  • 106