This document is about: SERVER 5

This page is a work in progress and could be pending updates.

Firewall Settings

If you are running a local Photon Server and noticed a bad event rate then this is most likely caused by logging. For instance, we noticed that enabling both Photon Server logging and Windows Defender may cause the event rate to slow down considerably. That is why we recommend disabling all virus scanners and firewalls when enabling Photon logging so you can have the expected events rate. You can re-enable the virus scanners and firewalls once you stop logging on Photon Servers.



要檢查設置,在Windows控制面板中打開Windows防火牆。 點擊 "允許程序通過Windows防火牆",確認 "PhotonSocketServer "被列出並被選中。

photon server: firewall settings
Photon Server: Firewall Settings


$fw = New-Object -ComObject hnetcfg.fwpolicy2 
$ruleTcp = New-Object -ComObject HNetCfg.FWRule
$ruleUdp = New-Object -ComObject HNetCfg.FWRule

$ruleTcp.Name = "Photon SocketServer TCP"
$ruleTcp.Protocol = 6 #NET_FW_IP_PROTOCOL_TCP
$ruleTcp.LocalPorts = "80,443,843,943,4520-4522,4530-4533,4540,4541,6060-6063,9090-9093,19090-19093"
$ruleTcp.Enabled = $true

$ruleTcp.Profiles = 7 #all
$ruleTcp.Action = 1 # NET_FW_ACTION_ALLOW

$ruleUdp.Name = "Photon SocketServer UDP"
$ruleUdp.Protocol = 17 #NET_FW_IP_PROTOCOL_Udp
$ruleUdp.LocalPorts = "5055-5058,40001,27000-27003"
$ruleUdp.Enabled = $true

$ruleUdp.Profiles = 7 #all
$ruleUdp.Action = 1 # NET_FW_ACTION_ALLOW

Back to top