mattbaker
I’m having so much fun working on the “Protohackers” challenges, I never got into Advent of Code much but this has been amazing. The challenges are all centered around protocols, so far they’ve all required you build a TCP server (gen_tcp makes it easy).
Also it’s an area Erlang/Elixir really excels at, so it’s fun to build lower level things that leverage all the great Erlang stuff, something I don’t think most of us get to do too often! Good opportunities to play with gen_tcp, messing with bits and bytes, and using binary pattern matching.
There’s an elixir channel in the protohacker discord if you decide to jump in! ![]()
Couple last things to mention:
- ngrok doesn’t work, it seems to mess with TCP traffic, so I opened a port in my firewall and forwarded it to my laptop, then I provided that port along with my public IP. I liked that because I didn’t have to bother deploying my app to a VPS/Fly.io/etc. I just closed the port when I was done.
- The Elixir intro actually has a section where you implement an echo server with gen_tcp, it’s perfect for getting started.
Trending in Challenges
Other Trending Topics
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 21 Posts
NobbZ
What you say sounds interesting, though the link you gave gives me a fat red warning that the certificate was invalid…
Ignoring it in a sandboxed Browser just shows “ok”…
mattbaker
Weird
No cert issues here, my browser is showing a valid cert issued by Let’s Encrypt.
I did update the URL, I had “/results” on there by accident (doesn’t explain your TLS issue though)
NobbZ
The cert I see is for api.protohackers.com, not including the upper level or any siblings.
LostKobrakai
I have the same issue, but it was fine earlier yesterday (before this thread was posted). Feels like there’s still some development happening any maybe something got misconfigured.
NobbZ
Between “first coffee” and “first coffee in office” something seems to have changed and now it works for me.
Lets assume there have been propagation or configuration issues.
As they posted problem 2 recently, the site doesn’t seem to be very old.
lud
I don’t understand the smoke test. What do they mean with “end of file”? I receive data and send it back, but then they close the connexion.
So that works with test
content.0but notcontent.1but I can’t figure out what they want. Any help?NobbZ
EOF is when the stream ends. Traditionally socket implementations will give you EOL at least once when you try to read from a socket that has been closed by the other side.
lud
Well the problem is unclear. If they close the socket I cannot echo back … And they say we must collect all the data they send before sending back. Anyway, buffer or not it does not work. Maybe my tunnel is bad, though it passes the first test.
NobbZ
If they close their end, you still have your end. Thats why they say in the FAQ that you can’t use
ngrokfor the smoke test.mattbaker
If you push up a repo with your code somewhere I’d be happy to take a look.
Lots of people free to help on the Discord too
There are channels for each problem.