I need to connect to a web page with node js server. There is a section in the site that accept some range of iP that they could have a request. Is it possible when I could load the page in Node ( e.g. puppeteer) when I need to click on some link on the page that needs specific IP, I spoof my IP?
Thanks
No, this is not possible, assuming the web page's server is using your network-level IP information. While you could spoof your IP address, you could not get a response back from the server: the source IP you send to the server is how the server knows where to send a response to complete a TCP handshake.
It's as if you're trying to get into a club that only allows in residents with addresses on Main Street. You go up to the bouncer, and say, "Hey, I live on Main Street! My address is 123 Main Street." And the Bouncer says, "Okay, we'll slip a secret code under the door at 123 Main Street; come back here with that code and we'll talk." You've successfully lied about your address, but unless you can prove that's your address (i.e., you genuinely have access to get inside the house at 123 Main Street), you aren't going to get in the club.
If you need to spoof your IP, you need control of a machine that really does have that IP address. One possibility is a proxy machine, which forwards messages between you and the server you want to talk to. If the proxy has a whitelisted IP address, and it doesn't advertise your real original IP, then the server has no way of knowing the request originally came from a machine with a non-whitelisted IP. In the Main Street analogy, imagine that the real owners of 123 Main Street say, "Anyone may come inside our house at 123 Main Street and collect mail," then you can get the secret code that the club sent there. Even though you don't really live at 123 Main, the owners might allow you to pretend you do.