Questions tagged [inets]

Inets is an Erlang application providing a container for Internet clients and servers, including an HTTP/1.1 compliant web server.

35 questions
1
vote
1 answer

inets httpc: client example in User's Guide not working

I copied the following code from the inets User's Guide: $ erl Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.2 (abort with ^G) 1> inets:start(). ok 2> httpc:set_options([{proxy,…
7stud
  • 46,922
  • 14
  • 101
  • 127
1
vote
1 answer

inets httpd: server example in User's Guide not working

I copied the code straight from the inets User's Guide: $ erl Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.2 (abort with ^G) 1> inets:start(). ok 2> {ok, Pid} = inets:start(httpd,…
7stud
  • 46,922
  • 14
  • 101
  • 127
1
vote
0 answers

Starting ibrowse to support unlimited requests to the server

I am using ibrowse to make POST and GET requests to the external server but I have issues when it comes to supporting frequent and simultaneous requests. I start ibrowse with default settings: application:start(ibrowse). Then I use ibrowse to…
1
vote
2 answers

Erlang HTTP: How do you include Body in an Inets or Ibrowse request?

I am currently using Inets with the following request: http:request(put, {Url, [{"User-Agent", UA}, {"Content-type", "application/json"}]}, Bodytext, []), But the request fails. Any suggestions?
Ted Karmel
  • 1,046
  • 1
  • 12
  • 20
1
vote
1 answer

Erlang: HTTP Accept Header with Inets

I am trying to do the equivalent of the following curl command : curl -H "Accept: text/plain" http://127.0.0.1:8033/stats I tried with an Inets simple http request. But, it isn't processed. How can I specify in Inets (or some other Erlang http…
Ted Karmel
  • 1,046
  • 1
  • 12
  • 20
1
vote
4 answers

Handling Erlang inets http client errors

I have an Erlang app which makes a large number of http calls to external sites using inets, using the code below case http:request(get, {Url, []}, [{autoredirect, false}], []) of {ok, {{_, Code, _}, _, Body}}-> case Code of 200 -> …
Justin
  • 4,649
  • 6
  • 33
  • 71
1
vote
4 answers

How to get more information about error when starting Inets httpd?

I started Inets http with: > inets:start(httpd, [{port, 8060}, {server_name, "myserver"}, > {server_root, "/Users/jonas/code"}, > {document_root, "/Users/jonas/code/mydocs"}, > {bind_address, {192, 168, 2,…
Jonas
  • 121,568
  • 97
  • 310
  • 388
1
vote
1 answer

How to start Inets httpd server?

I try to start Inets httpd server and have some documents in the document_root, but I can not start up the server. How can I start it? This is the config I start it with: >{ok, Pid} = inets:start(httpd, [{port, 8070}, {server_name,…
Jonas
  • 121,568
  • 97
  • 310
  • 388
1
vote
1 answer

Erlang: how to embed inets:httpd?

What is the proper way to embed the inets:httpd module inside an existing application? I would like an example / guidelines to achieving this, please. Updated: I want to be able to start an inets:httpd service dynamically from within an existing…
jldupont
  • 93,734
  • 56
  • 203
  • 318
1
vote
1 answer

Erlang inets httpc:request with Unicode

How to use httpc:request if the URL is a Unicode string? get_songs(Findstring) -> application:start(inets), application:start(crypto), application:start(public_key), application:start(ssl), Uf = normalize(Findstring), Ufs =…
Slowcoder
  • 57
  • 3
1
vote
1 answer

I cannot access to nitrogen/inets server from any machine but the localhost

Thanks to many discussions in this forum, I found that I should be able to build the application I was planning to do for home usage based on Nitrogen. So I ran into Nitrogen tutorials, Demo and docs, and start to do some tests based on the self…
Pascal
  • 13,977
  • 2
  • 24
  • 32
0
votes
3 answers

Erlang custom httpd module - how to send custom HTTP headers and Content-Type

I'm implementing a custom module for Erlang's httpd (inets) server. I can successfully respond with HTML content with the following implementation of do method: do(_ModData) -> Body = "Hello world", {proceed,…
Pawel Stolowski
  • 1,170
  • 1
  • 10
  • 9
0
votes
1 answer

Erlang: How to make an alias from 'erl_script_alias' to root url?

Here is the inets configuration file that I have: [{port, 443}, {server_name, "example.com"}, {server_root, "./root/"}, {document_root, "./htdocs/"}, {socket_type, {essl, [{certfile, "/etc/letsencrypt/live/example.com/cert.pem"}, {keyfile,…
0
votes
1 answer

inets httpd cgi script: Why am I getting a "No such file or directory" error?

When I try to request a cgi script from an inets httpd server, I get this error: sh: /Users/7stud/erlang_programs/inets_proj/cgi-bin/cgi-bin/1.pl: No such file or directory I notice that the cgi-bin component of the path is doubled. My cgi script…
7stud
  • 46,922
  • 14
  • 101
  • 127
0
votes
1 answer

inets httpd: server configuration file syntax (proplist_file)

What is the syntax for the configuration file when you start an httpd server like this: inets:start(httpd, [{proplist_file, "./server_config.txt"}] ). The httpd docs say: {proplist_file, path()} If this property is defined, Inets expects to…
7stud
  • 46,922
  • 14
  • 101
  • 127