Crowdhailer

Crowdhailer

Creator of Raxx

The latest release of Ace (0.10.0) includes serving content over HTTP/2.


I have started writing a webserver to teach my self more about webservers. Ace

The easiest thing is to probably summarize the plan here and if you want more details head on over to the README.

  1. To take this obviously deficient TCP echo server that I wrote as a beginner elixir developer and create a fully fledged HTTP server.
  2. Keep reasonable notes of progress so others can learn about how to build a web server in elixir.
  3. See what progress I have made in a year as an elixir developer.

Currently I have an issue which is confusing me (yes even at this beginner stage).
When I restart the server it often fails because the port is currently in use.
I call gen_tcp.close and am unsure why there is a delay in the port being properly closed?
Give the computer a few moments and the port does eventually become available again.

I know this is probably a help question but I didn’t want to post about my project twice and there are more things coming this way soon

Showing Posts 1 to 10

OvermindDL1

OvermindDL1

Hmm, I’ve not experienced that and am not in a short set of tests here. Can you give a reproducable iex or so session or a github repo with a test that demonstrates this? I’m quite curious as this sounds like it is not operating as it should…

Crowdhailer

Crowdhailer OP

Creator of Raxx

Hi.

What do you mean by reproducible iex session? just the list of commands that I entered that you can manually repeat?

I will also have a look at setting up a test.

OvermindDL1

OvermindDL1

Yep, quickest way to test, or a full git test that we can clone works too. :slight_smile:

mkunikow

mkunikow

So this will be some alternative to go https://caddyserver.com/ ? :slight_smile:

Crowdhailer

Crowdhailer OP

Creator of Raxx

:stuck_out_tongue_winking_eye: mebe.

Actually my goal is for it to have extremely readable source. I “almost” hope this makes it slow so that people know that its for demo purposes.

Crowdhailer

Crowdhailer OP

Creator of Raxx

Hi.

Thanks for the help. Quick question, Did you remember to comment out line 25 {:reuseaddr, true}. This line fixes the problem but I’m not really sure why.

The walk-through of commands after that takes two terminals.

# terminal 1
vagrant up
vagrant ssh
cd /vagrant
elixir server.ex

# terminal 2
vagrant ssh
telnet localhost 8080

# In telnet
CLOSE
# Connection closed by foreign host.

# terminal 1 
# restart server
elixir server.ex

# ** (MatchError) no match of right hand side value: {:error, :eaddrinuse}
#    server.ex:30: TCPEcho.start/1
#    (elixir) lib/code.ex:363: Code.require_file/2

# Wait a while.
elixir server.ex
# Listening on port: 8080



Crowdhailer

Crowdhailer OP

Creator of Raxx

Thanks to some pointers from helpful people I now understand this issue. I have added comments to the source code explaining reuseaddr.

Crowdhailer

Crowdhailer OP

Creator of Raxx

The latest release of Ace (0.10.0) includes serving content over HTTP/2.

Instructions for getting started can be found in this guide.
An example app is available here.

Features available at this point are

  • Stream isolation; one process per stream
  • Bidirectional streaming; stream data too and from clients
  • TLS(SSL) support via ALPN; data encrypted in transit
  • Raxx interface; simplicitfy for request/response interactions

Also see the Roadmap for remaining features.

An adapter for plug and therefore phoenix is not something I am looking at yet. My preference is to shore up the foundations prior to a 1.0 release. However if anyone wanted to look at this I would be happy to offer some help getting through the codebase.

Any feedback would be great. At this point I am particularly looking for comments around the API.
At this point the project is very alpha. However I hope to stabilise it quickly.

Crowdhailer

Crowdhailer OP

Creator of Raxx

Ace 0.11.0 is now tested with h2spec.

In strict mode Ace passes 143/146 of the h2spec test suite.
The remaining issues are all around hpack and choices on handling compression errors

For the full list of changes see the changelog.

OvermindDL1

OvermindDL1

Oooo, that is awesome!!!

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews