Joseph's Network Connection Status Indicator (NCSI) Service

This is Joseph's NCSI service. Like Captive Portal [English] [大陆简体] [香港繁體] or Microsoft Network Connection Status Indicator (NCSI) [English] [大陆简体] [香港繁體] , this site can check your network connection status.

However, this is a personal service or test purpose, and DOES NOT HAVE SLA GUARANTEE. Do not depend on it or use this service in production.

ToC

Generate 204

GET /generate_204
See Example

Give a response with HTTP status 204 No Content.


Connection Test

GET /connecttest.txt
See Example

If network is OK, it will have a response with text Joseph Studio Connection Test without CRLF.


IP Address

GET /ip.php
See Example

Return the IP address of client. Example: 203.0.113.1. [RFC 5737]


No CRLF at the end, but trim the result before use is recommended.

User Agent

GET /ua.php
See Example

Return the User-Agent HTTP header the client sent. Example: curl/7.55.1.

If User-Agent HTTP header is not sent, there will be a enpty body and Content-Length is 0. However, the HTTP status code is 200 instead of 204.

No CRLF at the end, but trim the result before use is recommended.


Client Time (JavaScript e-Clock)

GET /e-clock.html[?url-params][#format]
Timestamp | ISO 8601 | RFC 2822 | RFC 7231 | Universal Sortable Datetime (Local)

An dynamic e-clock.

URL Params
Name Default Description
background ffffff Background color in hex.
color 000000 Text color in hex.
lcd false Use LCD style font. Value can be true or 1, other value will be treated as false.
Foramts

We use moment.js to format time. For example, /e-clock.html#YYYY/MM/DD HH:mm returns 2006/01/02 15:04.

No forbidden characters, use [] to escape. Read the moment.js docs for detail.

Table below is format shoutcuts.

Format Alias Example Description
<null> timestamp 1136185445 By default (format param is not given, is null, is empty or whitespace string), returns a UNIX timestamp.
ISO ISO-8601 2006-01-02T15:04:05+08:00 ISO 8601 date and time format.
RFC RFC-2822 Mon, 02 Jan 2006 15:04:05 +0800 RFC 2822 date and time format.
HTTP RFC-7231 Mon, 02 Jan 2006 07:04:05 GMT HTTP date header format.
USDT - 2006-01-02 15:04:05 Universal Sortable Datetime (Local). Format is: yyyy-MM-dd HH:ii:ss, timezone is UTC+8.

Server Time

GET /time.php[?format=<format>]
Timestamp | ISO 8601 | RFC 2822 | RFC 7231 | Universal Sortable Datetime (Local)

Timezone, if available, will be set to UTC+8 and can not be changed (Except RFC 7231).

No CRLF at the end, but trim the result before use is recommended.

Forbidden Characters

Characters below are forbidden in the format string due to safety concerns.

< > ( )
$ = \x7f (DEL)
\00 - \1f

If forbidden characters appear in the format param, you will get a 400 Bad Request response. Headers below will appear:

X-Error: true
X-Error-Name: Unsupported Character in string
X-Error-Message: Returning Default Value (Timestamp)

And the returning string will in the default format (timestamp).

Foramts

We use PHP date function [Enlgish] [大陆简体] to format time. For example, /time.php?format=Y/m/d%20H:i returns 2006/01/02 15:04.

Table below is format shoutcuts.

Format Alias Example Description
<null> timestamp 1136185445 By default (format param is not given, is null, is empty or whitespace string), returns a UNIX timestamp.
ISO ISO-8601 2006-01-02T15:04:05+08:00 ISO 8601 date and time format.
RFC RFC-2822 Mon, 02 Jan 2006 15:04:05 +0800 RFC 2822 date and time format.
HTTP RFC-7231 Mon, 02 Jan 2006 07:04:05 GMT HTTP date header format.
USDTL - 2006-01-02 15:04:05 Universal Sortable Datetime (Local). Format is: yyyy-MM-dd HH:ii:ss, timezone is UTC+8.

HTTP Echo

GET /http-echo.txt
GET /http-echo.php [Alias of Text]
GET /http-echo.xml
GET /http-echo.html
GET /http-echo.json
Text | XML | HTML | JSON

Return all HTTP Headers.

Additional Parameters
Key Example Description
Remote-Addr 127.0.0.1 Client IP address.
Remote-Port 65534 Client TCP port for HTTP connection.
Https on Is a HTTPS connection, value may be "on", "off" or "".
Request-Time 1588131804 Request Timestamp, converted from the "Date" header in HTTP request.
Request-Scheme http/1.1 Request protocol, value may be null or empty string.
Request-Method GET Request method.
Annotation for Text Format

In Key: <value> foramt. Line ends with CRLF, has CRLF at the end.

Example:

Content-Length: 0
Host: 127.0.0.1
Connection: keep-alive
Remote-Addr: 127.0.0.1
Remote-Port: 32980
Https: off
Request-Time: 1588131804
Request-Scheme:
Request-Method: GET

Annotation for XML Format

By default the XML has a stylesheet, so it appears like the HTML format when you view in a browser. However, if you see the source code, it is XML.

XML namespace is https://xml-schemas.josephcz.xyz/xmlns/2020/httpecho-2.0. XSLT style at httpecho-2.0.xsl.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="httpecho-2.0.xsl"?>
<HttpEcho xmlns="https://xml-schemas.josephcz.xyz/xmlns/2020/httpecho-2.0">
  <Content-Type/>
  <Content-Length>0</Content-Length>
  <Upgrade-Insecure-Requests>1</Upgrade-Insecure-Requests>
  <Host>127.0.0.1</Host>
  <Connection>keep-alive</Connection>
  <Remote-Addr>127.0.0.1</Remote-Addr>
  <Remote-Port>33716</Remote-Port>
  <Https>off</Https>
  <Request-Time>1588132916</Request-Time>
  <Request-Scheme/>
  <Request-Method>GET</Request-Method>
</HttpEcho>