yaws

Fails to build Yaws on Mac OS X 10.9

我怕爱的太早我们不能终老 提交于 2021-01-28 04:23:29
问题 I downloaded Yaws 1.98, but when executing ./configure && make if fails with the message provided below: gcc -c -g -O2 -I/usr/include/security -m64 -I/usr/include/pam -DHAVE_SENDFILE -I"/usr/local/lib/erlang/usr/include" -I/usr/include/pam/ epam.c epam.c:2:10: fatal error: 'pam_appl.h' file not found #include <pam_appl.h> ^ 1 error generated. make[1]: *** [epam.o] Error 1 make: *** [all] Error 1 Any suggestions on how to solve this? is there any other way I can run the latest version of Yaws

Installing Yaws server on Ubuntu 12.04 (Using a cloud service)

假如想象 提交于 2019-12-23 02:45:23
问题 I'm trying to get a Yaws web server working on a cloud service (Amazon AWS). I've compilled and installed a local copy on the server. My problem is that I can't get Yaws to run while running on either port 8000 or port 80. I have the following configuration in yaws.conf: port = 8000 listen = 0.0.0.0 docroot = /home/ubuntu/yaws/www/test dir_listings = true This produces the following successful launch/result: Eshell V5.8.5 (abort with ^G) =INFO REPORT==== 16-Sep-2012::17:21:06 === Yaws: Using

REST API implementation using Yaws

六月ゝ 毕业季﹏ 提交于 2019-12-22 10:13:06
问题 I'm trying to build a REST API using the Yaws web server but I'm unable to get Yaws to dispatch requests to my module. -module(rest). -include_lib("stdlib/include/qlc.hrl"). -include_lib("yaws/include/yaws_api.hrl"). -export([out/1, addAirport/4, handle/2]). -compile(export_all). -define(RECORD_TYPE, airport). -define(RECORD_KEY_FIELD, code). -record(airport, {code, city, country, name }). start() -> application:start(mnesia). do_this_once() -> mnesia:create_table(airport, [{attributes,record

Erlang and JavaScript MD5 Digest match

£可爱£侵袭症+ 提交于 2019-12-21 15:39:23
问题 Testing the Javascript Implementation of MD5 here: http://www.webtoolkit.info/javascript-md5.html gives the following output: MD5("muzaaya") = "00e081abefbbbf72b2d5258196a9b6d0" Going to my erlang shell, and calculating the MD5 of the same value i get this: Eshell V5.8.4 (abort with ^G) 1> erlang:md5("muzaaya"). <<0,224,129,171,239,187,191,114,178,213,37,129,150,169, 182,208>> 2> How can i compare the two? If the MD5 result from the JavaScript front end app comes to my Erlang backend, i would

Output data of Erlang List as a HTML in Yaws

送分小仙女□ 提交于 2019-12-13 06:44:02
问题 Have a look at my index.yaws file below <html> <body> <h4>Data:</h4> <erl> out(Arg) -> Data = utilities:get_raw_data(), {html, io_lib:format("~p", [Data])}. </erl> <erl> out(Arg) -> Data = utilities:get_raw_data(), lists:foreach(fun(X) -> {Id, Fname, Lname} = X, io:format("ID: ~p ", [Lname]) end, Data). </erl> </body> </html> The first part of the code runs correctly producing output such as [{3,"Matt","Williamson3"}, {2,"Matt","Williamson2"}, {1,"Matt","Williamson"}] There is no error on the

How to configure yaws webserver in the linux terminal?

我的梦境 提交于 2019-12-13 04:51:32
问题 can someone help me on to write my yaws webserver configuration file in the Linux terminal. when i follow the yaws tutorials i get errors. thanks a lot. 回答1: This is how I installed Yaws 1.89 on Ubuntu Server 10.10 . 1. Update your Ubuntu system sudo apt-get update sudo apt-get upgrade 2. Install the tools you need to compile sudo apt-get install gcc sudo apt-get install libpam0g-dev 3. Download, compile and install Yaws 1.89 wget http://yaws.hyber.org/download/yaws-1.89.tar.gz tar xfz yaws-1

How to send message to receive in YAWS/Erlang

淺唱寂寞╮ 提交于 2019-12-10 19:22:38
问题 Normally in Erlang programmers use ! symbol to send message to receive in concurrent programming but how do we do it in yaws? Say I am trying to do this> <erl> out(Arg) -> loop("bad"). loop(X)-> receive good -> {html, "Good"}; bad -> {html, "bad"} end. </erl> This program keeps waiting for a message, How do I send message to it? 回答1: If you want to have one process send a message to another, it's clear you need two processes. When Yaws receives a HTTP request, by default it dispatches the

How to handle WebSocket messages in an appmod using Yaws?

 ̄綄美尐妖づ 提交于 2019-12-10 10:47:00
问题 I have created a simple appmod that sends back the same message as it receives. But I get an error message at the command prompt and the WebSocket connection is closed. If I send a message with 3 chars I get this error message: =ERROR REPORT==== 8-Feb-2012::05:09:14 === Error in process <0.59.0> with exit value: {undef,[{mywebsocket,handle_message,[ {text,<<3 bytes>>}],[]},{lists,map,2,[{file,"lists.erl"},{line,1173}]},{yaws_web sockets,loop,4,[{file,"yaws_websockets.erl"},{line,151}]}]} What

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

不问归期 提交于 2019-12-08 03:47:40
问题 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 = function(evt) {} is never executed on the JavaScript client. When I use the same JavaScript client code interacting with a node.js websocket, the client receives an onclose event immediately after ws.close(); . Here is the code for my simple

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

时间秒杀一切 提交于 2019-12-06 16:47:18
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 = function(evt) {} is never executed on the JavaScript client. When I use the same JavaScript client code interacting with a node.js websocket, the client receives an onclose event immediately after ws.close(); . Here is the code for my simple appmod : -module(mywebsocket). -export([handle_message/1]). handle_message({text, Message}) -> {reply,