DWQA QuestionsCategory: Artificial IntelligenceAbout Java sending requests using user IP
tannde asked 13 mins ago

On Java, you need to call a public IP interface, which cannot be accessed multiple times with the same IP. Therefore, this interface cannot be accessed with my server’s IP, but with the client’s IP.
The expected process is as follows:

Send the request to the server with your own IP address
Client =========================================================================

   Use client IP to request a public IP
==============================Public IP returns data to the server

   The server returns the data to the client
=============================Client gets data

Ask if you guys have a procedural solution,remote_ The address is not easy to forge, but x-forwarded-for is OK,X-Forwarded-For
Java forged IP,Is the other party intercepted at http layer or TCP / IP layer?The former can be carriedX-Forwarded-ForRequest header.The latter requires IP spoofing, but this is not what Java can do. It needs the help of third-party tools (such as ipspoof). Java can’t do it because the standard library doesn’t provide relevant underlying support (that is, there is no native layer code). Of course, you can use java package one layer after writing in C.

_usw replied 1 hour ago

IP is not forged if you want to forge it

_usw replied 1 hour ago

What are the business requirements? Can you directly let the client access and send the data back?

_usw replied 1 hour ago

Without this function, you can’t do it

_usw replied 1 hour ago

Haven’t you learned the course of computer network?

_usw replied 1 hour ago

This functional requirement, I think

2 Answers
Bug development answered 1 hour ago

remote_ The address is not easy to forge, but x-forwarded-for is OK,X-Forwarded-For
Java forged IP

Then go hiking answered 1 hour ago

Is the other party intercepted at http layer or TCP / IP layer?The former can be carriedX-Forwarded-ForRequest header.The latter requires IP spoofing, but this is not what Java can do. It needs the help of third-party tools (such as ipspoof). Java can’t do it because the standard library doesn’t provide relevant underlying support (that is, there is no native layer code). Of course, you can use java package one layer after writing in C.