有什么方法可以以编程方式连接到Java中的VPN?

问题描述 投票:-1回答:1

有什么方法可以以编程方式连接到Java中的VPN?而且它不是全局系统级代理,类似于用于一次性HttpClient请求的代理。我对VPNS不太了解。例如,如何使用HttpClient连接到代理服务器https://222.111.111.111并设置用户名和密码?我知道它可能涉及SSLVPN或openssl之类的东西,但是我现在很困惑。enter image description here

java httpclient vpn
1个回答
0
投票

我建议研究Selenium for Java。这是问题的登录名和密码部分的基本解决方案。

    WebElement login = driver.findElement(By.id("ctl00_ContentPlaceHolder1_Login1_UserName"));//example html div id of the username window
    String userName = "your username";
    String userPassword = "your password";
    login.clear();
    login.sendKeys(userName);
    WebElement password = driver.findElement(By.id("ctl00_ContentPlaceHolder1_Login1_Password"));//example html div id of the password window
    password.clear();
    password.sendKeys(userPassword);
    driver.findElement(By.id("ctl00_ContentPlaceHolder1_Login1_LoginButton")).click();//example html div id of the login button
© www.soinside.com 2019 - 2024. All rights reserved.