248 questions
1
vote
1
answer
370
views
How to send MIME (Multipart Media Encapsulation) content type message using erlang HTTP method?
I'm currently working on a module in Erlang that sends an HTTP POST request with a multipart/related message containing both JSON and binary data. However, I'm facing issues with concatenating the ...
1
vote
1
answer
494
views
Failed to start Ranch listener https_listener in ranch_ssl:listen, for reason eacces (permission denied) on Linux
I'm trying to build a simple Erlang server with Cowboy on a Linux machine. However, when I run the server, I get the following error:
=INFO REPORT==== ===
application: test_app
exited: {...
0
votes
0
answers
236
views
Cowboy 2.9.0 reverse proxy websockets
I am a newer of elixir。I
need to forward the websocket request from the cowboy sever http://127.0.0.1:4000/api to another server http://127.0.0.1:8080/abc. In short, how to implement reverse proxy ...
1
vote
0
answers
130
views
Erlang cowboy matching multiple routes
I want to match requests as /friend_request/something ; /friend_request/somethingElse in the same module. I have the following code
defmodule Server do
def start() do
dispatch_config = ...
0
votes
1
answer
126
views
Creating a minimal Plug based http server in an exs file
I am trying to create a quick n dirty http server in an exs file that only sends the string 'Hello World'. Currently it's
Mix.install([{:plug_cowboy, "~> 2.0"}])
defmodule HWPlug....
2
votes
0
answers
132
views
Erlang Cowboy crashing. How to change logging levels?
I am running an Erlang Cowboy server and it strangely crashes sometimes with the error message:
> heart: Thu Dec 23 08:31:33 2021: Erlang has closed.
heart: Thu Dec 23 08:31:33 2021: Would reboot. ...
0
votes
0
answers
257
views
How to create a keep-alive API endpoint with Cowboy in Elixir?
Note: I am new to elixir and the forum, and hence my question might be missing some details. Do let me know if additional information is required from my end.
I am trying to integrate the trading view’...
5
votes
1
answer
600
views
Cowboy/Ranch kills handler process when client closes connection
I have Phoenix application with complex business logic behind HTTP endpoint. This logic includes interaction with database and few external services and once request processing has been started it ...
2
votes
1
answer
822
views
Chat room in erlang with cowboy and websocket
I'm trying to create a chatroom with cowboy websocket handler.
I want that messages those come from every will be forwarded to other sockets as well, just like a chat group.
I don't have any idea how ...
1
vote
1
answer
247
views
How to spawn a cowboy server in a test?
Background
I have a specific test where I need to spawn a cowboy server listening on port 8082 that returns some static responses.
Objective
Normally I would spin up a cowboy process in my application....
6
votes
1
answer
950
views
Why does the Pry shell timeout so quickly in Phoenix/cowboy? (shell process exited with reason: shutdown)
When I use IEx.pry or a breakpoint (via :int.break()), the interactive shell dies too quickly, and I only have ~10 seconds before I lose my session:
** (EXIT from #PID<0.606.0>) shell process ...
1
vote
1
answer
285
views
Syntax error when compiling cowboy for elixir project
I have a Dockerfile which builds an elixir project. Here, I compile both erlang
and elixir from source. Afterwards I just run docker build --build-arg ... new-image . and it works without any errors. ...
1
vote
1
answer
125
views
Set metadata in user_data for cowboy_metrics_h
I include cowboy_metrics_h into stream_handlers in my cowboy application.
How I can put data in user_data?
Where I should do it?
1
vote
1
answer
676
views
How to set body to Cowboy POST response
I have simple Cowboy rest handler:
-module(request_handler).
-export([
init/2,
allowed_methods/2,
content_types_accepted/2,
content_types_provided/2
]).
-export([
json_request/2,
...
1
vote
1
answer
152
views
Cowboy Listeners
Trying to find detailed information about listeners and using more than one listener for application.
So I am wondering what may happen if I continue to use about 15 listeners with different ports on ...
2
votes
1
answer
492
views
Cowboy: How do you present a static html file from a handler?
I am using cowboy and I have a post method to a handler which checks for user name and password. This all works great.
Many of the examples show how to return a simple hello message in response. ...
1
vote
1
answer
661
views
Erlang Cowboy, Server Side Event, eventsource close and reconnects about every 60 seconds
I have the cowboy example eventsource running on a local Debian server. For the code please see --> https://github.com/ninenines/cowboy/tree/master/examples/eventsource
After about 60 seconds there ...
0
votes
3
answers
644
views
Erlang Cowboy running two web servers on one machine using different ports
Newbie to erlang and cowboy. I am using some open source code which uses cowboy and listens to port 8080 to provide a ng-admin admin service.
I want to know if its possible for cowboy to also listen ...
1
vote
1
answer
160
views
Passing ID of websocket connection between testcases (Common Test) , Erlang
Who can help me?
I have server that based on websockets.
I want to test API using common tests (CT) passing connection ID between testcases and using only one connection for all testcases.
Test cases ...
2
votes
1
answer
502
views
Erlang Ranch Websocket Client fails to detect dropped Internet connection
I've written a very standard websocket client using Gun. It works as expected, connects, sends and receives messages, etc. Everything is very normal.
However, I discovered that it doesn't detect a ...
1
vote
1
answer
244
views
How to disable HTTP Methods on cowboy server
i need help on how to disable HTTP methods on my cowboy server.
Tried to search on the internet but eneded up with no solutions
-1
votes
1
answer
122
views
Simple Elixir / Plug Processes Issue - PID not sticking around
I'm just starting out in Elixir and wanted to build a very simple API with Plug. I used this guide to get a very simple API up and running.
Basically, the problem I'm facing is that the process that I ...
0
votes
1
answer
281
views
How to handle 404 in cowboy_static when file not found
I have very important query regarding cowboy_static
{"/api/assets/[...]",cowboy_static, {dir,"/home/upload_dir/"}},
{"/api/assets/[...]",cowboy_static, {dir,"/home/upload_dir/"}},
Everything is ...
3
votes
0
answers
2k
views
Ranch Listener Error failed on phoenix websocket implementation
I have implemented websocket to my phoenix app. Before it success to connected and joined room to my websocket, but right now i got this error:
error] Ranch listener MarketPlaceDisbursementServiceWeb....
0
votes
1
answer
255
views
Error coming while upgrading cowboy to cowboy2
I have elixir application which I am using with plug(no Phoenix), I was trying to upgrade it to cowboy2 from cowboy. I am using VS code for development, I keep getting following error when I am ...