Giter Club home page Giter Club logo

Comments (5)

megoRU avatar megoRU commented on September 26, 2024 1

http://my-domain.com:51821/api/session

from wg-easy-wrapper.

MachineSaver avatar MachineSaver commented on September 26, 2024 1

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.

megoRU avatar megoRU commented on September 26, 2024

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.

MachineSaver avatar MachineSaver commented on September 26, 2024

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.

megoRU avatar megoRU commented on September 26, 2024

nice to hear

from wg-easy-wrapper.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.