Silvan
Silvan

Reputation: 23

How to create PPTP connection with Java?

I need to check what accounts from my huge list are still valid on VPN-server, but I haven't found any information on how to do it with Java language. How do I connect to PPTP-server using Java?

I created a socket with the server ip and PPTP-port, just like this, according to PPTP working over TCP:

    Socket pptpSocket = new Socket("51.15.151.165", 1723);
    PrintWriter out = new PrintWriter(pptpSocket.getOutputStream(), true);
    BufferedReader in = new BufferedReader(new InputStreamReader(pptpSocket.getInputStream()));

    System.out.println(in.readLine());

It connects well, but answers me nothing and I don't really know how to send my credentials on this socket properly, so I'll get a PPTP tunnel. Maybe I'm doing it wrong, but what is the right way? How can I establish the connection I want?

Upvotes: 1

Views: 918

Answers (0)

Related Questions