Comments (5)
http://my-domain.com:51821/api/session
from wg-easy-wrapper.
Dude you are my hero. Thanks for this, now I can interact with the instance from a script running on the computer I'm installing the vpn on instead of manually generating from the UI. Much appreciated!
from wg-easy-wrapper.
If I understood correctly, you are connecting by IP
You can declare a variable in a separate class in the . public static final field. And already interact with WG-EASY through this instance. I also want to clarify that it is better to check the session. She may log out after some time.
When you create an instance, it is already a session. You can work with it until it runs out. You can update it by setSession();
public class WgEasyStorage {
public static final WgEasyAPI api = new WgEasyAPI.Builder()
.password("password")
.ip("xxx.xxx.xxx.xxx")
.port(51821)
.build();
}
Wrap this code in an endless stream.
www.codejava.net
if (WgEasyStorage.api != null) {
Session session = WgEasyStorage.api.getSession();
if (session != null) {
boolean authenticated = session.isAuthenticated();
if (!authenticated) {
WgEasyStorage.api.setSession();
}
}
}
from wg-easy-wrapper.
I am trying to talk to the API of wg-easy from my home computer over the internet to the server that is running on a cloud platform. I am pointing my domain at the IP address of the server running WG-easy.
http://my-domain.com:51821
This, of course, resolves to an IP address.
So if I did a simple curl request would it look like this?
curl -X POST \
-H "Content-Type: application/json" \
-d '{"password":"WebGUI_Password_for_WG-Easy"}' \
http://my-domain.com:51821
Does this make sense?
from wg-easy-wrapper.
nice to hear
from wg-easy-wrapper.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wg-easy-wrapper.