Search code examples
rtspmms

How to get server information from URL?


mms://58.231.196.73/busanmbc-fm-onair-20120228 is an audio streaming URL. When I input this to a web browser, it plays radio.

The default port of MMS is 1755 and that of RTSP is 554. When I input mms://58.231.196.73:1755/busanmbc-fm-onair-20120228 to a web browser, it doesn't work and in case of mms://58.231.196.73:554/busanmbc-fm-onair-20120228 it works.

I wonder how a web browser recognizes the RTSP default port as the port of that URL even though it is MMS of which default port is 1755.


Solution

  • Many well-known protocols have default ports, see Wikipedia. In your case the URL scheme contains the required information to determine the protocol and thus port number.

    Update: I can promise you, that there is no port information hidden in the URL you provided, other than the scheme.

    From RFC 3986 we know that there is either an explicitly named port:

    The port subcomponent of authority is designated by an optional port number in decimal following the host and delimited from it by a single colon (":") character.

    Or a default port derived from the scheme:

    A scheme may define a default port. For example, the "http" scheme defines a default port of "80"