5 ms·
Show HN: A simple echo server for testing HTTP clients
I have developed an application called "echoserver" and I would like to share its details on Hacker News. The purpose of "echoserver" is to simplify the testing of HTTP clients. It functions as an echo server, meaning it responds to requests by echoing back the received data. This allows users to simulate various server responses and test their HTTP clients accordingly.
With "echoserver," users can generate custom responses by specifying the desired status code, headers, and response body. This flexibility enables thorough testing of HTTP clients and simplifies the process of verifying client behavior under various scenarios. Whether it's testing error handling, handling specific headers, or evaluating performance under different response sizes, "echoserver" provides a convenient solution.
Overall, "echoserver" aims to streamline the testing process for developers and enhance their ability to verify the functionality and robustness of their HTTP clients. Its simplicity, versatility, and user-friendly interface make it an invaluable tool in the development and testing workflow. I invite the Hacker News community to explore and provide feedback on the app, as I believe it has the potential to greatly benefit developers and testers worldwide.
- playingalong 3y agoSo something like https://httpbin.org https://httpbin.org (which BTW recently has some capacity issues)
- caboteria 3y agohttpbin is also abandoned - there hasn't been a commit in 5 years despite 50 PR's in the queue.
- vdfs 3y agoWhat i get from this project: I'll never understand HN front page algorithm
- Aachen 3y agoBesides moderator involvement, it's not an obscure algorithm so much as people clicking the vote button and this counter being divided by the post's age to keep the page fresh. People like yourself are what decide what makes it onto the homepage.
- tailspin2019 3y agoThis audience understands how hard it is to actually make a thing, get it out there in the world, share it, and brace for impact for the inevitable criticism. Someone made a thing and put it out in the world. Worthy of some upvotes in my view.
- pixl97 3y agoHN has had thousands of posts like this by someone making something that was interesting to them and sharing it with others. That's part of the hackers ethos. I wouldn't consider myself a developer or programmers, but more on the support side. I've made little tools like this when trying to figure out what's going with our proprietary software. By setting up 'fake' servers that dump as much debug information as possible you can get a lot of useful information. Especially when the application developer decides not to put functionality like that in the product in the first place.
- deofoo 3y agoIt will be cool if you add some quick script for s self-hosted version. And thank for sharing the source code.
- __s__ 3y agoThank you for your comment! I plan to add it in the next implementation.
- nickjj 3y agoA few years ago I put together: https://github.com/nickjj/webserver https://github.com/nickjj/webserver It's a self hosted zero dependency / single file Python based echo server. You run `webserver 8000` and then you can make HTTP requests to `localhost:8000` with whatever URL path, headers and payload you want and it'll echo it back.
- francislavoie 3y agoYou can also use Caddy to do this. Single static binary, use the "respond" command to spin up a super simple server that responds with the text and headers you want: https://caddyserver.com/docs/command-line#caddy-respond https://caddyserver.com/docs/command-line#caddy-respond also gives you Automatic HTTPS out of the box, production ready proxy, etc.
- tailspin2019 3y agoLooks great. Nice execution, simple UI and a good domain too! If you want people to use the hosted version I would suggest adding a basic privacy policy/statement. A key reason why I don't tend to use hosted versions of these tools is just due to the danger of me sending something to the endpoint that I need to keep confidential. I don't use live/customer data during development, but it could even just be a test API key for a system I'm integrating into - low risk - but still something I wouldn't want hitting an external endpoint. So you need to give some confidence that you throw away all incoming requests and aren't logging anything. Secondly, looking at the project overall, to gain some more traction it might be good to add some basic quick-start "how to self host" instructions and possibly publish your released versions to GitHub Releases? I'm guessing you probably would prefer people to use your hosted version but some will never do this (for above reasons). So they'll either go elsewhere - or - you can "capture" that group of people by giving them a good onboarding experience for self-hosting! It does depend on your goals for the project though, and how much time you intend to spend on it. Edit: deofoo got there before me on the self-host instructions suggestion :-) https://news.ycombinator.com/item?id=36020050 https://news.ycombinator.com/item?id=36020050
- __s__ 3y agoThank you for your comment! I appreciate your constructive advice. I will take it into consideration for the next implementation.
- crinic 3y ago[flagged]
- gpmcadam 3y agoThere’s no need to be harsh. It takes a lot of bravery for people to put things here under the Show HN tag and for all you know this was something that took a lot of effort and hard work to achieve. Maybe you don’t find it useful but others might. If not I’d suggest keep scrolling or give positive or constructive feedback to the OP.
- bheadmaster 3y agoAre we supposed to care whether you're impressed or not?
- janmarsal 3y agoYes
- sureglymop 3y agoWhat a sad comment. There are all kinds of people here and I'm sure not all of them are web developers. Computer science alone is an extremely vast field with many different disciplines and I'm sure that is not the only background people on here have. Please don't discourage people from sharing and showcasing something that may be interesting to someone other than yourself.
- tyilo 3y agoThe url generated isn't valid according to curl: curl -v 'https://echoserver.dev/server?query={"headers":[["foo","bar"]],"body":{"type":"text","data":"asdasdasadsasdasd"},"status":200}' curl: (3) nested brace in URL position 48: https://echoserver.dev/server?query={"headers":[["foo","bar"]],"body":{"type":"text","data":"asdasdasadsasdasd"},"status":200} It also sends a lot of extra headers: CF-Cache-Status: DYNAMIC CF-Ray: 7cacf9735d5c7373-CPH Connection: keep-alive Date: Sun, 21 May 2023 12:55:33 GMT Server: cloudflare Set-Cookie: __cf_bm=cAVNRtth0_6tpGLa8p2wbe6EuPRO2ZKITru5y9_GYgE-1684673733-0-AUMvqDbcxAHGRLPD2ghFL+6yJ0RKm0kGPtzsiU4jFChGrB02xtkPe8I2OX6+kFApwcWiEI1p+mFNA+esRO58cVI=; path=/; expires=Sun, 21-May-23 13:25:33 GMT; domain=.echoserver.dev; HttpOnly; Secure; SameSite=None Set-Cookie: _cfuvid=wP9ezST2Ks4reP.MMtYKTxisnCjBHSGc65SDqhRDdCU-1684673733888-0-604800000; path=/; domain=.echoserver.dev; HttpOnly; Secure; SameSite=None Transfer-Encoding: chunked Vary: Accept-Encoding alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400 x-render-origin-server: Render
- afn 3y agoBy default, curl interprets braces and square brackets to expand into multiple URLs (similarly to bash and other shells). You can disable this, and use literal braces & brackets in URLs, by passing ‘-g’ (‘--globoff’).
- layer8 3y agoBraces and square brackets (as well as double quotes) are not allowed unencoded in query strings, see the definition of pchar in https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 https://datatracker.ietf.org/doc/html/rfc3986#section-3.4.
- __s__ 3y agoThat's true. Although it will make the URL longer, I have decided to use encodeURIComponent to escape characters and avoid potential bugs.
- joeframbach 3y agoBased on this user's post history, I doubt you'll get a response. And seeing that the post was obviously written by chatgpt, I doubt they'll even be back to read your post.
- supriyo-biswas 3y agoIt seems OP has written their Show HN post using ChatGPT, with the 3-part essay style and a conclusion. While I understand the temptation to use LLMs, now I wonder if OP had a genuine intention in advertising their service here, or whether they just wanted free marketing without any effort on their part.
- leesalminen 3y agoI had the exact same thought after the first 2 sentences.
- loloquwowndueo 3y agoFor me the telltale was the last paragraph: summary starting with “Overall”.
- __s__ 3y agoI'm sorry. English is not my native language, and I lack confidence in it, so I used ChatGPT.
- maksimur 3y agoWould you mind sharing the prompts? My writing skills are horrible and I'm thinking about using LLMs to improve myself.
- samwillis 3y agoI'm Dyslexic and so also lack confidence in my writing. LLMs are transformative for people like us, if they had been around when I was at school it would have been an incredible experience. I can also completely understand the motivation to use it on HN, when I make mistakes in my comments, stupid ones like using the wrong word, and then get called out it hurts. Chin up, you built a useful tool!
- tailspin2019 3y agoAgreed! Context is important.
- eatonphil 3y agoI wrote something similar in Go for writing HTTP client integration tests. It's a very useful concept for quick tests. https://github.com/multiprocessio/httpmirror https://github.com/multiprocessio/httpmirror
- sslbuddy 3y agonice app ! we will be happy to support your project with domain cert from https://sslgram.com https://sslgram.com, ping us via email if needed.
- codeplea 3y agoVery cool. I can definitely see this being useful for me in the future. I made a similar tool which simply outputs the exact HTTP request as received by the server. It's useful to test how the client is mangling URLs or packing request body data. It was actually not so easy to implement, as basically every production web-server mangles the request before making it available. So I wrote it from scratch in C. It's at http://httpparrot.com/ http://httpparrot.com/