-
Notifications
You must be signed in to change notification settings - Fork 24
Web Access
PC² supports two different methods of allowing teams to connect to the server. The first is the Application Team Client method. To use this approach, the PC² system must installed on each team's computer.
An alternative is to have teams use a web browser to connect to the PC² server. Older PC² versions used a component called the EWTeam to support such web access. Using the EWTeam required the Contest Administrator to configure and install a set of services into an existing webserver (the mechanism used to do this is discussed in the PC² Contest Administrator's Guide).
Starting with Version 9.7, PC² provides a much simpler method of supporting team access via a web browser. A new component called the Web Team Interface (WTI) was added to the system. The WTI provides a fully self-contained webserver which knows how to communicate with a running PC² server; all the Contest Administrator has to do is start the WTI "web team server" and teams can immediately connect to PC² using a browser.
To start the WTI web team server, go to the PC² installation folder, navigate to the projects
folder, and unzip the WebTeamInterface-xx.zip (or .tar.gz) file found there to any convenient location. In the resulting WebTeamInterface-xx folder, type the command ./bin/pc2wti
. This starts the web team server listening on a default port of 8080; teams can connect to the web team server (and thus to PC²) using a URL like http://<ip>:8080
, where <ip>
is the IP address of the machine on which the web team server is running.
There are two "port numbers" relevant when using the WTI web team server. The first is the port on which the WTI server listens for browser connections from teams. The default for this port is 8080, but is configurable; it can be changed by editing the wtiport= property in the [server] section of the pc2v9.ini
file found in the WTI startup folder, followed by restarting the web team server.
The other relevant port is the port through which the WTI server connects to the PC² server. The WTI web team server is effectively a client of the PC² server; as such it communicates with the PC² server just like all other PC² clients -- by using the PC² server IP and port specified in the server= property of the [client] section of the pc2v9.ini file in the WTI startup directory. The default value for this property is server=localhost:50002, which is where the WTI web team server will by default attempt to connect to the PC² server.
If however the PC² server is started listening for client connections on a different port than the 50002 default, that port number must be entered in the server= entry in the pc2v9.ini file in the WTI startup folder.
Note also that if the PC² server is running on a different machine than the web team server, the IP address of the PC2² server machine must also be entered in the same server= entry in the [client] section of the web team server's pc2v9.ini file.
One additional consideration arises if the WTI server is running behind a Network Address Translation (NAT) service. In this case it is possible that the WTI server will not communicate properly with a browser client that has contacted it through the public-facing IP address provided by NAT (that is, the IP address through which team browser clients connect to the WTI server). To circumvent this communication problem, the pc2v9.ini file in the WTI startup folder should have an entry like the following added to it: wtiOverridePublicIP=w.x.y.z
, where w.x.y.z
is the PUBLIC-facing IP of the WTI server. This will override the WTI's default behavior of returning its local IP address to the client, causing it to instead return the specified public IP address.