7 ms·
Armor – Simple HTTP server, supports HTTP/2 and auto TLS
- jwcrux 10y agoWhy would I want to use this over something like Caddy?
- beardog 10y agoAgreed. This is just Caddy with less features.
- e12e 10y agoWhen you put it like that, it sounds like a good reason to prefer Armor over Caddy for some use cases :-)
- nikolay 10y agoThis is based on Echo v3, which is a ultra fast web server framework, but, again, we need to see benchmarks of Armor vs Caddy.
- insertnickname 10y agoEcho is fast largely because it is based on Go's standard library net/http server, the same as Caddy.
- Matthias247 10y agoI haven't used any of them, but I would expect the same. There seem to be a lot of "router" or "middleware" benchmarks nowadays, but from my experience that performance difference is negligible compared to what a different protocol or IO stack implementation can do, e.g. using blocking IO vs. using async IO, buffering and write strategies, etc. If both use net/http I wouldn't expect any difference that really matters in real applications. fasthttp seems to make a difference, but as far as I can read from the documentation it isn't used in Echo v3.
- ngrilly 10y agoNot really. Echo can use net/http or fasthttp. When using net/http, there is no significant performance gain. All the performance benefit comes from replacing net/http by fasthttp. Source: https://github.com/labstack/echo/tree/v3 https://github.com/labstack/echo/tree/v3
- caleblloyd 10y agofasthttp doesn't support HTTP/2 or web sockets yet. If you don't need either, it is a fantastic library. Source: https://github.com/valyala/fasthttp/blob/master/TODO https://github.com/valyala/fasthttp/blob/master/TODO
- insertnickname 10y agoBut Echo v3, which Armor is based on, does not support fasthttp.
- ngrilly 10y agoThanks, I missed that!
- deleted 10y ago[deleted]
- clacke2 10y agoI was going to say, if one wants a go web server with LetsEncrypt there's also https://docs.traefik.io/ https://docs.traefik.io/ . I have heard about Caddy, but had forgotten it is also written in go. So now there's (at least) three.
- V_Levin12 10y agoGood tip! There is also HTTP/2 web servers like H20 (written in C) and ShimmerCat (Haskell). However they are more focused on the problem of fighting latency I believe
- ofiner2 10y agocan it be used as a library? for a go web app which already uses built-in http server?
- michaelmior 10y agoAs the README mentions, it's built on the Echo[0] framework. You would likely just want to use Echo directly if you want to embed the server in your app. [0] https://github.com/labstack/echo https://github.com/labstack/echo
- e12e 10y agoEh...: "Armor accepts configuration in JSON format, command-line option -c can be used to specify a config file, e.g. armor -c config.json." Ok, it might be better than Apache's mongrel mix of not-quite and SGML/XML dialect -- but I'd much rather see something like YAML than having to write JSON by hand. I suppose I should just write a compiler (or use one, I'm sure simple YAML maps pretty well 1:1 to simple JSON).
- JimmyM 10y agoWhat's wrong with writing JSON by hand? I've never touched YAML before, but JSON seems pretty clear to me - doesn't feel much different to writing a list naturally. Is YAML one of those things that proper professional programmers need but us amateurs can botch our way around?
- pcx 10y agoJSON for configuration is a cute idea that doesn't scale at all. I've personally experienced this in a project at my job. Once the config gets substantially large, it becomes a headache. The real pain is when a sysadmin without any experience in JSON screws up the formatting or tries to change the config and can't decipher the parse errors. JSON for config is a bad, bad idea - especially if your config will get large.
- anc84 10y ago[{[[{[{[{[{}]}}}]}]]}] Spot the typo! If you think this is stupid because surely everyone uses an editor with automatic scope highlighting etc, I don't think that is the case when you are remotely editing config files via SSH.
- heinrich5991 10y agovim works via SSH. :)
- michaelmior 10y agoIf you work on a team with someone who writes config files like that, I think you've got bigger problems.
- mostafah 10y ago+1 for not saying “written in Go” in the title.
- arno1 10y agoEh... if only the configuration was in YAML (or TOML)...