Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: A simple echo server for testing HTTP clients (echoserver.dev)
59 points by __s__ on May 21, 2023 | hide | past | favorite | 36 comments
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.




It 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.


I'm sorry. English is not my native language, and I lack confidence in it, so I used ChatGPT.


I'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!


Agreed! Context is important.


If you just used it as translation service then I see no need to even bring it up, but if you wrote three lines of actual information and had a computer expand that to three paragraphs of text then it should be common courtesy to disclose that people are wasting their time reading the added boilerplate


Would you mind sharing the prompts? My writing skills are horrible and I'm thinking about using LLMs to improve myself.


You could add “write this in the style of an ‘Show HN’ submission” to the prompt.


I had the exact same thought after the first 2 sentences.


For me the telltale was the last paragraph: summary starting with “Overall”.


why would we care about the intentions or the tooling used for the HN post (or the project for that matter)? if they had used an English dictionary would we have a problem with this? I think we should judge these "Show HN" on their value like utility or novelty. Of course people posting their project to HN want advertising/free marketing.

I agree if this was one of those empty blog posts; if the whole post is an article generated by an LLM, by all means downvote.


i wonder if their prompt will actually be a better summarization


The 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


I didn't test it with curl because I was assuming it would be used on the frontend, but as afn mentioned, I think it should work correctly if you add -g as shown below: curl -g -v 'https://echoserver.dev/server?query={"headers":[["foo","bar"...}'

Also, I am using render.com for hosting, and render.com uses Cloudflare internally, so it seems that related headers are also included. However, I believe this should not be a problem for testing purposes.


By 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’).


Braces 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.


That's true. Although it will make the URL longer, I have decided to use encodeURIComponent to escape characters and avoid potential bugs.


Based 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.


Looks 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


Thank you for your comment! I appreciate your constructive advice. I will take it into consideration for the next implementation.


It will be cool if you add some quick script for s self-hosted version. And thank for sharing the source code.


You 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 also gives you Automatic HTTPS out of the box, production ready proxy, etc.


A few years ago I put together: 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.


Thank you for your comment! I plan to add it in the next implementation.


So something like https://httpbin.org (which BTW recently has some capacity issues)


httpbin is also abandoned - there hasn't been a commit in 5 years despite 50 PR's in the queue.


Very 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/


I 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


nice app ! we will be happy to support your project with domain cert from https://sslgram.com, ping us via email if needed.


[flagged]


There’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.


What 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.


Are we supposed to care whether you're impressed or not?


Yes


What i get from this project: I'll never understand HN front page algorithm


Besides 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.


HN 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.


This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: