-
John Doe
erlang webserver cowboy
Trying out Cowboy (Erlang) http library, helloworld example: https://github.com/extend/cowboy/tree/master/examples/hello_worldWhen using Apache’s “ab” testing tool in this manner, I get “connection reset”:d7 ~/cb/cowboy/examples/hello_world % !564 ab -n 30000 -c 5000 http://127.0.0.1:8080/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/Benchmark
-
mattk
erlang undef cowboy
I am trying to run a custom application but get multiple errors. I believe the main egs app gets an error because it calls the egs patch app which has an undefined type. I cant figure out how to get this working I have tried recompiling the code many times in regards to others with a similar problem but nothing seems to work. The cowboy start listener remains undefined.This is the error I receive.=CRASH REPORT==== 10-Apr-2013::21:02:00 ===crasher:initial call: application_master:init/4pid: <0
-
sibbl
erlang webserver cowboy
I am currently playing around with minimal web servers, like Cowboy. I want to pass a number in the URL, load lines of a file, sort these lines and print the element in the middle to test IO and sorting. So the code loads the path like /123, makes a padded “00123” out of the number, loads the file “input00123.txt” and sorts its content and then returns something like “input00123.txt 0.50000”.At the sime time I have a test tool which makes 50 simultaneous requests, where only 2 get answered, t
-
user601836
erlang websocket cowboy
I have seen many examples of chat room systems over websocket implemented with erlang and cowboy. Most of the examples I have seen use gproc. In practice each websocket handler registers itself with gproc and then broadcasts/receives messages from it.Since a user could close by accident the webpage I am thinking about connecting to the websocket handler a gen_fsm which actually broadcasts/receives all the messages from gproc. In this way the gen_fsm could switch from a “connected” state to a “di
-
couchemar
rest erlang cowboy
How can I enable CORS for cowboy rest handler? I tried to add options/2 method, like this:options(Req, State) ->{[{<<“access-control-allow-origin”>>, <<“*”>>},{<<“access-control-allow-methods”>>, <<“GET, OPTIONS”>>}], Req, State}.but this causes errors like:Error in process <0.263.0> with exit value: {{case_clause,{[{<<27 bytes>>,<<1 byte>>},{<<28 bytes>>,<<12 bytes>>}],{http_req,#Port<0.2
-
Max Grigoriev
erlang cowboy
How can I set status code in my REST POST resource.Now I’m doing this make_post(Req, State) ->lager:info(“post”),Resp = cowboy_req:set_resp_body(<<“HELLO POST\n”>>, Req),{ok, Resp3} = cowboy_req:reply(201, Resp),{true, Resp3, State}.But I receive such errors:1:43:10.510 [info] [nonode@nohost#pbshare_logic_registration#<0.205.0>] [handle_info#35] :Exit Logic from <0.204.0> Reason: {function_clause,[{cowboy_req,reply,[204,[],<<>>,{http_req,#Port<0.6355>,ranch_tcp,kee