Hello I have Client Server
Socket = new Scoket; //192.168.0.130
ServerSocket = new ServerSocket(3000); //192.168.0.131
I connect external vpn to the client-server. As a result I get ServerSocket with ip 8.8.8.8 , Socket 8.8.8.7 (so shows debager) But Socket does not connect to the Serversocket with connection address 8.8.8.8(does not find server). However, the Socket connects to the server at the address 192.168.0.131, although it has an ip 8.8.8.8.
What to change, so that the client connects to the vpn ip 8.8.8.8?
Необходимо указать локальный сетевой интерфейс (с VPN), к которому биндится сокет (localInterface):
Socket s = new Socket(hostname, port, localInterface, 0);
Аналогично для ServerSocket.
Сборка персонального компьютера от Artline: умный выбор для современных пользователей