top | item 36019664

Show HN: A simple echo server for testing HTTP clients

59 points| __s__ | 2 years ago |echoserver.dev

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.

36 comments

order

supriyo-biswas|2 years ago

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.

__s__|2 years ago

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

leesalminen|2 years ago

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

lazyant|2 years ago

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.

slmjkdbtl|2 years ago

i wonder if their prompt will actually be a better summarization

tyilo|2 years ago

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

__s__|2 years ago

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.

afn|2 years ago

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

joeframbach|2 years ago

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.

tailspin2019|2 years ago

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

__s__|2 years ago

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

deofoo|2 years ago

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

nickjj|2 years ago

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.

__s__|2 years ago

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

playingalong|2 years ago

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

caboteria|2 years ago

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

codeplea|2 years ago

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/

sslbuddy|2 years ago

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

crinic|2 years ago

[deleted]

gpmcadam|2 years ago

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.

sureglymop|2 years ago

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.

bheadmaster|2 years ago

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

vdfs|2 years ago

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

Aachen|2 years ago

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.

pixl97|2 years ago

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.

tailspin2019|2 years ago

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.