Enhanced community-maintained fork with modern Mirror compatibility This release is tagged as v16 to reflect continued maintenance and accumulated changes.
This release builds upon Speidy674's V14 maintenance work and 4t0m1c's modernization work (V15) from Derek-R-S's original work, with additional features cherry-picked from painh's fork, upstream PRs/issues, and additional fixes identified during maintenance.
- Mirror 93.0.0+ Compatibility - Full support for modern Mirror versions
- .NET 8.0 Upgrade - Enhanced performance and latest framework features
- Enhanced Stability - Fixed network component sync issues with current Mirror
- Better Performance - Optimized buffer management and memory allocation
- Improved Reliability - Enhanced error handling and connection state management
- Property-based API with
IsServer/IsClientproperties - Comprehensive data validation and bounds checking
- Integrated Newtonsoft.Json for robust serialization
- Enhanced debugging and logging capabilities
- Fixed SimpleWebTransport FQDN resolution issues
From painh's fork:
- Web dashboard UI (
/api/endpoint) - In-memory log store with
/api/logsendpoint (pagination supported) /api/healthendpoint- IP whitelist via
ALLOWED_IPSenvironment variable (dashboard & logs) - Git commit time displayed in dashboard and
/api/stats - Docker build time support via
build_time.txt - Korean log messages for client connect/auth/room events
From upstream PR #28 (Oyshoboy):
- More flexible Room ID generation β numerical IDs supported via
RandomlyGeneratedIDNumericalconfig
Fixes for upstream Issue #37 (VoidFletcher):
- Fixed typo
NATPunchtroughServerβNATPunchthroughServerandNATPunchtroughPortβNATPunchthroughPort - Deprecated aliases kept in
Config.csfor backwards compatibility with existingconfig.jsonfiles (logs a warning)
Other fixes:
- Empty server list no longer returns a network error on the client side (
"[]"is now pre-compressed as a static field) - Simplified
.csproj: removed Costura.Fody in favor of nativePublishSingleFile - AppId filtering on server list endpoints (
/api/servers/{appId},/api/compressed/servers/{appId}) - SSL support in
EndpointServer.Start()viabool sslparameter
Light Reflective Mirror is a transport for Mirror Networking which relays network traffic through your own servers. This allows you to have clients host game servers and not worry about NAT/Port Forwarding, etc. This enhanced version ensures compatibility with modern Unity and Mirror versions while maintaining all original functionality.
- WebGL Support, WebGL can host servers!
- Built in server list!
- Relay password to stop other games from stealing your precious relay!
- Relay supports connecting users without them needing to port forward!
- NAT Punchthrough (Full Cone, Restricted Cone, and Port Restricted Cone)
- Direct Connecting
- Load Balancing with multi-relay setup
- Web dashboard with log viewer
- AppId-based server list filtering
- IP whitelist for dashboard/logs
- Modern Mirror 93.0.0+ compatibility
- .NET 8.0 performance improvements
I took a bit of a unique approach to this version and instead of using one fixed net library for the game to communicate with the standalone relay server, I instead made it use any of mirrors transports! This allows you to make it work with websockets, Ignorance(ENET), LiteNetLib, and all the others!
This is a drop-in replacement for Speidy674's V14:
- β Full protocol compatibility with V14 and original LRM
- β Works with existing server deployments
- β Same API, enhanced performance
- β No code changes required
β οΈ config.jsonkeysNATPunchtroughServer/NATPunchtroughPortstill work but log a deprecation warning β rename them toNATPunchthroughServer/NATPunchthroughPort
(I recommend these over the text format)
https://www.youtube.com/watch?v=0SpKIs0Beuo
https://www.youtube.com/watch?v=Wi0rp2b8KmM
First things first, you will need:
- Mirror, Install that from Asset Store.
- Download the latest release of Light Reflective Mirror Unity Package and put that in your project also. Download from: Releases.
Running a client is fairly straight forward, attach the LightReflectiveMirrorTransport script to your NetworkManager and set it as the transport. Put in the IP/Port of your relay server, assign LightReflectiveMirror as the Transport on the NetworkManager. Then attach the SimpleWebTransport script and assign that in the 'ClientToServerTransport' in the Light Reflective Mirror inspector. When you start a server, you can simply get the URI from the transport and use that to connect. If you wish to connect without the URI, the LightReflectiveMirror component has a public "Server ID" field which is what clients would set as the address to connect to.
If your relay server has a password, enter it in the relayPassword field or else you wont be able to connect. By default the relays have the password as "Secret Auth Key".
Light Reflective Mirror has a built in room/server list if you would like to use it. To use it you need to set all the values in the 'Server Data' tab in the transport. Also if you would like to make the server show on the list, make sure "Is Public Server" is checked. Once you create a server, you can update those variables from the "UpdateRoomInfo" function on the LightReflectiveMirrorTransport script.
To request the server list you need a reference to the LightReflectiveMirrorTransport from your script and call 'RequestServerList()'. This will invoke a request to the server to update our server list. Once the response is recieved the field 'relayServerList' will be populated and you can get all the servers from there.
Download the latest Server release from: Releases Make sure you have .NET 8.0 Runtime And all you need to do is run LRM.exe on windows, or "dotnet LRM.dll" on linux!
In the config.json file there are a few fields.
TransportDLL - This is the name of the dll of the compiled transport dll.
TransportClass - The class name of the transport inside the DLL, Including namespaces! By default, there are 5 compiled transports in the MultiCompiled dll. To switch between them you have the following options:
- Mirror.TelepathyTransport
- kcp2k.KcpTransport
- Mirror.SimpleWeb.SimpleWebTransport
- MultiCompiled.KcpWebCombined
AuthenticationKey - This is the key the clients need to have on their inspector. It cannot be blank.
UpdateLoopTime - The time in miliseconds between calling 'Update' on the transport
UpdateHeartbeatInterval - the amounts of update calls before sending a heartbeat. By default its 100, which if updateLoopTime is 10, means every (10 * 100 = 1000ms) it will send out a heartbeat.
ALLOWED_IPS - Comma-separated list of IPs allowed to access the dashboard and /api/logs. Empty = everyone allowed. 127.0.0.1 is always allowed.
| Component | Original LRM | Speidy674 V14 | 4t0m1c v15 | This Release (v16) |
|---|---|---|---|---|
| .NET Framework | 5.0 | 7.0 | 8.0+ | 8.0+ |
| Mirror | Up to ~30.x | Up to ~50.x | 93.0.0+ | 93.0.0+ |
| Unity | 2020.3+ | 2021.3+ | 2021.3+ | 2021.3+ |
There are quiet a few relay transports for mirror at this point, It can often be difficult to pick one that most suits your needs. So I'll quickly go over my view on it and hopefully it helps you make an informed decision.
Starting with steam, steam offers a free relay with NAT punchthrough for anyone releasing a game on steam. This integrates into their lobby invites and also only allows connections from other users who actually own the game (No pirates sneaking into your servers!) and it works wonders. Steam has well documented SDK, a huge community, and they are active on their forums. If you plan on releasing on steam and only steam, go with this. To get the steam relay, go into the #steam channel in mirror's discord and use whichever one is the same as your wrapper.
Epic is a newer transport that offers NAT Punchthrough, and a relay service for free. As of writing this its only available for usage on Windows/Mac/Linux (More platforms are planned and releasing in the future). This one is great because they offer it for free! Thats right, a free relay and NAT punchthrough server, plus more! They have more tools such as Matchmaking, server browser, statistics, and more! This is NOT locked into only releasing on Epic Store, like how steams is. So you can release on any store you want if your game uses this. Now onto the downsides, they have a very PITA SDK to use with a fairly small community for the C# side of things. (FakeByte helps alot in the discord and will help with features outside of the relay transport!). The documentation is sub-par and severely lacking in some places, which is expected as its fairly new. They also have Epic Account Services, which is similar to steams but like the relay, not locked into one store! With those services you get user accounts, In game purchases, achievements, and much more. So if you want a free relay/NAT Punchthrough server, and want to go along for the ride of EoS, this is the one. You cant beat free. :P Check it out here
LRM is a self-hosted, open source, relay/NAT Punchthrough server. It's available for all platforms (PC, Mac, Linux, WebGL, Android, IOS, You name it!). It does this by supporting any of mirrors existing transports. If you want webgl? Use websockets! Want TCP? Telepathy! UDP? KCP! This is one of LRM's main features. The game developer can decide on how they want their data sent between the server and clients. With LRM, you are going to have to host the servers yourself. We are releasing a load balancer soon which will make it super easy to expand servers in regions and balance users out between them. The more powerful of a server you have, the more that LRM node can host. With some tests (All clients relayed, none NAT punched), we could get about ~200 CCU on a $5 google cloud server (f1-micro). This enhanced v15 version ensures LRM continues working with modern Mirror versions while maintaining all these benefits. So, if you are more of a self-hosting person, who wants full control of your servers, or want a relay for a platform the others don't support (WebGL). Use LRM, if you have any questions, we are in the discord channel everyday! :)
Maintenance Chain:
- Derek-R-S - Original creator and maintainer through v12
- Speidy674 - Community maintenance fork, V14 with .NET 7 upgrade
- Biebras - V14 bug fixes and improvements
- 4t0m1c - V15 Mirror compatibility and .NET 8 modernization
- painh (sihyun) - Web dashboard, log viewer, IP whitelist, AppId filtering
- Oyshoboy - Flexible Room ID generation (PR #28)
- VoidFletcher - NATPunchthrough typo report (Issue #37)
Original Contributors:
- Cooper - Assisted with development and made some wonderful features! He's also active in the discord to help answer questions and help with issues.
- Maqsoom & JesusLuvsYooh - Both really active testers and have been testing it since the idea was pitched. They tested almost all versions of DRM and LRM!
- All Mirror Transport Creators! - They made all the transports that this thing relies on! Especially the Simple Web Transport by default!
- Original: Derek-R-S/Light-Reflective-Mirror (v1-v12)
- V14 Base: Speidy674/Light-Reflective-Mirror (community maintenance)
- V15 Base: 4t0m1c/Light-Reflective-Mirror (previous major modernization)
- This Release: KX712/Light-Reflective-Mirror (dashboard, fixes, upstream PRs)
