diff --git a/rtmp/parseurl.go b/rtmp/parseurl.go index cc197fb9..4fea7d82 100644 --- a/rtmp/parseurl.go +++ b/rtmp/parseurl.go @@ -99,16 +99,15 @@ func parseURL(addr string) (protocol int32, host string, port uint16, app, playp } } - if port == 0 { - switch { - case (protocol & featureSSL) != 0: - port = 433 - return errUnimplemented - case (protocol & featureHTTP) != 0: - port = 80 - default: - port = 1935 - } + switch { + case port != 0: + case (protocol & featureSSL) != 0: + return protocol, host, port, app, playpath, errUnimplemented // port = 433 + case (protocol & featureHTTP) != 0: + port = 80 + default: + port = 1935 } + return protocol, host, port, app, playpath, nil }