Server Setup Overview

When using the custom backend option, you need to deploy a server to handle friend data. Universal Friend List includes two server implementations: a Node.js server with WebSocket support and a PHP server for simpler hosting.

Choosing a Server Type

FeatureNode.js ServerPHP Server
TransportWebSocket + HTTP RESTHTTP REST only
Real-time UpdatesYes (WebSocket)No (polling only)
DatabaseSQLite (default)SQLite or MySQL
ScalingHorizontal (with sticky sessions)Single server / shared hosting
HostingNode.js hosting requiredStandard PHP hosting
Best ForProduction, real-time needsSimple projects, shared hosting

When Is a Server Needed?

You need a server when:

  • Using Mirror, Unity Netcode, or FishNet
  • Using Custom Backend option with Photon
  • You need cross-platform friends
  • You need server-side moderation
  • Your game has dedicated servers

You may NOT need a server when:

  • Using Photon PUN or Fusion with Native Implementation
  • Prototyping without real multiplayer

Architecture Overview

Both servers provide the same REST API endpoints for friend operations. The Node.js server additionally provides WebSocket for real-time events:

Unity Client └── FriendManager └── INetworkFriendSystem └── CustomBackendFriendSystem ├── BlinkBoxServerClient HTTP └── BlinkBoxWebSocketClient WS REST calls / WebSocket Server ├── Node.js: REST + WebSocket └── PHP: REST only Database Database ├── SQLite Node.js default └── MySQL PHP option

Server-Specific Documentation

Security Considerations

Important: These are sample servers for development and prototyping. Before production deployment:
  • Use HTTPS/WSS in production
  • Implement proper authentication tokens
  • Add rate limiting to prevent abuse
  • Validate all user input server-side
  • Use production-grade database connections
  • Consider input sanitization for SQL queries