I don’t think many browsers will allow posting to 127.0.0.1 from a random website. What’s the threat model here?
Restricting such access it is still a work in progress: https://wicg.github.io/local-network-access/
I think any browser will allow it but not allow data read back.
Restricting such access it is still a work in progress: https://wicg.github.io/local-network-access/