Support specifying API endpoins via java props
- Add support fo specifying runelite.session.url java prop to be used instead of RuneLite session base - Add support fo specifying runelite.http-service.url java prop to be used instead of RuneLite api base url - Add support fo specifying runelite.ws.url java prop to be used instead of RuneLite websocket url - Add support for specifying runelite.static.url java prop to be used instead of RuneLite s.r.n url Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -97,21 +97,49 @@ public class RuneLiteAPI
|
||||
|
||||
public static HttpUrl getSessionBase()
|
||||
{
|
||||
final String prop = System.getProperty("runelite.session.url");
|
||||
|
||||
if (prop != null && !prop.isEmpty())
|
||||
{
|
||||
return HttpUrl.parse(prop);
|
||||
}
|
||||
|
||||
return HttpUrl.parse(BASE + "/session");
|
||||
}
|
||||
|
||||
public static HttpUrl getApiBase()
|
||||
{
|
||||
final String prop = System.getProperty("runelite.http-service.url");
|
||||
|
||||
if (prop != null && !prop.isEmpty())
|
||||
{
|
||||
return HttpUrl.parse(prop);
|
||||
}
|
||||
|
||||
return HttpUrl.parse(BASE + "/runelite-" + getVersion());
|
||||
}
|
||||
|
||||
public static HttpUrl getStaticBase()
|
||||
{
|
||||
final String prop = System.getProperty("runelite.static.url");
|
||||
|
||||
if (prop != null && !prop.isEmpty())
|
||||
{
|
||||
return HttpUrl.parse(prop);
|
||||
}
|
||||
|
||||
return HttpUrl.parse(STATICBASE);
|
||||
}
|
||||
|
||||
public static HttpUrl getWsEndpoint()
|
||||
{
|
||||
final String prop = System.getProperty("runelite.ws.url");
|
||||
|
||||
if (prop != null && !prop.isEmpty())
|
||||
{
|
||||
return HttpUrl.parse(prop);
|
||||
}
|
||||
|
||||
return HttpUrl.parse(WSBASE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user