server.protocol

NES2+Syntax

server.protocol

Description

The protocol property of the server object contains the protocol to which the server is responding. This includes the information up to the first colon, as in http:.

Example

Listing 8.137 writes the port of the server to the user's page.

Listing 8.137 Accessing the port Property
<SERVER>

// Write the port property to the user's page
write(server.port);

</SERVER>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.