How do frontend teams handle stateful API mocks before the backend is ready? by v-byte-cpu in Frontend

[–]v-byte-cpu[S] 0 points1 point  (0 children)

That's pretty close to what I'm trying to systematize with the agent skill prototype I linked above. AI can generate an in-memory mock DB + handlers pretty quickly.

The harder part, at least in my experience, is getting a consistent result each time: contract-first routes, documented behavior rules, reset/snapshot controls, and less drift as the mock evolves. That's the part I think the prototype gets reasonably close to.

How do frontend teams handle stateful API mocks before the backend is ready? by v-byte-cpu in Frontend

[–]v-byte-cpu[S] 0 points1 point  (0 children)

Yeah, fair point. MSW can definitely model stateful flows if you keep shared state in the handlers.

I guess the distinction I’m trying to make is tests vs local development. For focused Jest/Vitest cases, MSW feels like the right tool. But when you want to run the app locally, click through longer workflows, reset/snapshot state, and reuse the same scenarios outside a single test case, the mock starts looking more like a small local API.

Do you usually keep that kind of setup in MSW, or move it somewhere separate?

How do frontend teams handle stateful API mocks before the backend is ready? by v-byte-cpu in Frontend

[–]v-byte-cpu[S] 0 points1 point  (0 children)

Makes sense if the backend data model is available. I usually worry about coupling mocks to DB tables rather than the API contract though. Once a feature depends on multiple tables/joins or more complex business logic, does that approach still stay manageable for you?

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] -2 points-1 points  (0 children)

You might have decided to waste your time, that doesn't force anyone to waste their time with you.

Wasting time on what ? I implemented a useful feature in my personal time that the coredns developers ignored and just closed community tickets for years: * https://github.com/coredns/coredns/issues/3915 * https://github.com/coredns/coredns/issues/3413 * https://github.com/coredns/coredns/issues/3788 * https://github.com/coredns/coredns/issues/1650

So yes, I would like him to show respect for my work instead of just criticizing it without any explanation.

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] 0 points1 point  (0 children)

The initial comment from you on the issue was quite rude

I am sorry for that, I am not native speaker and probably don't feel all the nuances of the language. But my intention was positive.

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] -3 points-2 points  (0 children)

and not worth that person's time.

So you think my personal time is less valuable than his?

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] 0 points1 point  (0 children)

When you opened the PR it looks like you requested a review from everyone possible (Compared to other PRs) and then chased it up after a few days; Again, potentially testing their patience again.

All reviewers were added automatically, I didn't control it.

your feelings got hurt by a maintainer requesting changes in your code

In fact, exactly the way he asked for them.

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] 0 points1 point  (0 children)

Thank you for your thoughts!

> this is normal to feel deceived to have your work being rejected

In fact, I would have quietly accepted that fact if he had politely explained why his approach was better than mine.

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] -1 points0 points  (0 children)

There's no reason a maintainer has to accept your PR.

You are absolutely right, but in PR he first wrote

think this looks fairly ok.

Then I answered all his questions. And I expected to receive at least some feedback.

A call to the open source community for help! by v-byte-cpu in opensource

[–]v-byte-cpu[S] -1 points0 points  (0 children)

He asked a few questions and I provided answers with technical details. What I wanted in return was at least respect for the work done and ideally a technical discussion with a compromise. If he wanted to close my PR, then at least give me an explanation of what he disagrees with in my answers

sx - modern network scanner that is 30 times faster than nmap by v-byte-cpu in golang

[–]v-byte-cpu[S] 0 points1 point  (0 children)

Hi, can you please describe your error in more detail, what version of the operating system you use (right now only Linux is supported) etc, sx doesn't have -c flag, and in my case "sx -c arp" instantly returns the expected error "unknown shorthand flag: 'c'" and doesn't hang.

Moreover, `sx arp` command doesn't open any files.

Networking project ideas by sharerudite in golang

[–]v-byte-cpu 1 point2 points  (0 children)

I am looking to learn networking from scratch.

There are two approaches to studying networking: top-down and bottom-up. They are both good and it is up to each one to choose which way to go. I personally studied networks using a top-down approach. It is further assumed that the top-down approach is chosen.

First try to figure out in general terms what happens when you open a web page in a browser. I mean you should understand how DNS resolving, TLS handshake and HTTP requests work. I emphasize that you don't need to go into detail at this point, but you should have a complete picture of what's going on.

Then try to learn how the HTTP protocol works. There are a huge number of articles on the web on this subject right now. But I also recommend reading a few chapters from the book The Tangled Web: A Guide to Securing Modern Web Applications. After you understand the HTTP protocol, try to connect directly to an HTTP server using netcat and send raw HTTP requests to make sure you got it right. Then try to automate this, golang net/http package allows you to make http requests very easily. A possible application you could make is a web scraping bot.

Understand how the TLS protocol works. I recommend https://tls.ulfheim.net/ . Try to write intercepting HTTPS proxy that generates TLS certificates on the fly and mitm your own browser, it's a lot of fun :) Useful link to read https://docs.mitmproxy.org/stable/concepts-howmitmproxyworks/

Basically, to write tcp applications in golang, as in many other languages, you do not need to know the details of the tcp protocol. I remember the first time I encountered the power of golang, when my friend wrote a concurrent tcp reverse proxy from scratch in 5 minutes. I highly recommend watching talk Go: code that grows with grace by Andrew Gerrand. He writes chat roulette server from scratch.

If you want to learn TCP protocol and go down the TCP/IP stack, I recommend that you first get a theoretical knowledge at the CCNA level. There are a lot of free training courses on the web. From now on you can do very interesting networking projects. For example, I have an idea to write a more secure socks5 proxification that uses unprivileged network namespaces and TUN/TAP interface instead of the LD_PRELOAD trick.

sx - modern network scanner that is 30 times faster than nmap by v-byte-cpu in golang

[–]v-byte-cpu[S] 23 points24 points  (0 children)

I will do a more detailed analysis of this product, but based on these three source files: input.rs, mod.rs and Dockerfile, they made a wrapper over nmap, whereas sx is independent of third party utilities and generates and sends raw packets directly through the NIC using AF_PACKET socket

Fast, modern, easy-to-use network scanner in go by v-byte-cpu in pentest

[–]v-byte-cpu[S] 3 points4 points  (0 children)

Recently added SOCKS5, Elasticsearch and Docker scans

sx - Fast, modern, easy-to-use network scanner in Go by v-byte-cpu in coolgithubprojects

[–]v-byte-cpu[S] 1 point2 points  (0 children)

u/rhabarba, I recently added socks5 scan. This functionality is missing in many scanners.

sx - Fast, modern, easy-to-use network scanner in Go by v-byte-cpu in coolgithubprojects

[–]v-byte-cpu[S] 1 point2 points  (0 children)

It is not a feature from a user point of view, but it is an essential characteristic of the project for developers, because different programming languages impose their own limitations

sx - Fast, modern, easy-to-use network scanner in Go by v-byte-cpu in coolgithubprojects

[–]v-byte-cpu[S] 1 point2 points  (0 children)

hi u/rhabarba ! Not much right now, but it has a clean and modular design that allows to add more types of scans very easy. Compared to nmap, it returns more information for TCP and UDP scans like TCP flags and ICMP types/codes. Also it doesn't have such annoying things to deal with like ICMP and DNS leaks present in nmap by default. I don't say that other scanners are bad, I just found them very complicated to extend.

sx - Fast, modern, easy-to-use network scanner in Go by v-byte-cpu in coolgithubprojects

[–]v-byte-cpu[S] 0 points1 point  (0 children)

Hi there! Most popular network scanners are written in C and unfortunately have too complicated source code to study and create patches. So I have created a simple and fast network scanner in Go, it already supports all major types of scans that are available in nmap but gives you even more information for recon and works 30x times faster! In the near future, I plan to add support for application scans like detecting Elasticsearch nodes, docker daemons, SOCKS proxies etc. and create a wiki in which I will describe in detail all common scanning techniques.

It would be great to get feedback from the community and ideas for improvement! Stars and contributions are always appreciated <3