Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vrc-oscquery-lib/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static bool OSCTypeFor(Type type, out string oscType)
public const string TAGS = "TAGS";
public const string UNIT = "UNIT";
public const string VALUE = "VALUE";

public const string LISTEN = "LISTEN";
#endregion

#region Service Types
Expand Down
9 changes: 9 additions & 0 deletions vrc-oscquery-lib/HostInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;

namespace VRC.OSCQuery
Expand Down Expand Up @@ -26,6 +27,12 @@ public class HostInfo
[JsonProperty(Keys.OSC_TRANSPORT)]
public string oscTransport = Keys.OSC_TRANSPORT_UDP;

[JsonProperty(Keys.WS_IP)]
public string wsIP = IPAddress.Loopback.ToString();

[JsonProperty(Keys.WS_PORT)]
public int wsPort = OSCQueryService.DefaultPortHttp;

/// <summary>
/// Empty Constructor required for JSON Serialization
/// </summary>
Expand All @@ -48,6 +55,8 @@ public class Keys
public const string OSC_PORT = "OSC_PORT";
public const string OSC_TRANSPORT = "OSC_TRANSPORT";
public const string OSC_TRANSPORT_UDP = "UDP";
public const string WS_IP = "WS_IP";
public const string WS_PORT = "WS_PORT";
}
}
}
9 changes: 8 additions & 1 deletion vrc-oscquery-lib/OSCQueryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@ public int OscPort
set => HostInfo.oscPort = value;
}

public int WsPort
{
get => HostInfo.wsPort;
set => HostInfo.wsPort = value;
}

public string ServerName {
get => HostInfo.name;
set => HostInfo.name = value;
}

public IPAddress HostIP { get; set; } = IPAddress.Loopback;
public IPAddress OscIP { get; set; } = IPAddress.Loopback;

public IPAddress WsIP { get; set; } = IPAddress.Loopback;

public static ILogger<OSCQueryService> Logger { get; set; } = new NullLogger<OSCQueryService>();

public void AddMiddleware(Func<HttpListenerContext, Action, Task> middleware)
Expand Down
14 changes: 14 additions & 0 deletions vrc-oscquery-lib/OSCQueryServiceBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ public OSCQueryServiceBuilder WithOscIP(IPAddress address)
return this;
}

public OSCQueryServiceBuilder WithWsPort(int port)
{
_customStartup = true;
_service.WsPort = port;
return this;
}

public OSCQueryServiceBuilder WithWsIP(IPAddress address)
{
_customStartup = true;
_service.WsIP = address;
return this;
}

public OSCQueryServiceBuilder StartHttpServer()
{
_customStartup = true;
Expand Down