44 "encoding/json"
55 "fmt"
66 "net"
7- gourl "net/url"
7+ "net/url"
88 "reflect"
99 "regexp"
1010 "sort"
@@ -372,8 +372,12 @@ func (pconf *Path) validate(
372372 }
373373
374374 case strings .HasPrefix (pconf .Source , "rtsp://" ) ||
375- strings .HasPrefix (pconf .Source , "rtsps://" ):
376- _ , err := base .ParseURL (pconf .Source )
375+ strings .HasPrefix (pconf .Source , "rtsps://" ) ||
376+ strings .HasPrefix (pconf .Source , "rtsp+http://" ) ||
377+ strings .HasPrefix (pconf .Source , "rtsps+http://" ) ||
378+ strings .HasPrefix (pconf .Source , "rtsp+ws://" ) ||
379+ strings .HasPrefix (pconf .Source , "rtsps+ws://" ):
380+ _ , err := url .Parse (pconf .Source )
377381 if err != nil {
378382 return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
379383 }
@@ -390,7 +394,7 @@ func (pconf *Path) validate(
390394
391395 case strings .HasPrefix (pconf .Source , "rtmp://" ) ||
392396 strings .HasPrefix (pconf .Source , "rtmps://" ):
393- u , err := gourl .Parse (pconf .Source )
397+ u , err := url .Parse (pconf .Source )
394398 if err != nil {
395399 return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
396400 }
@@ -406,15 +410,11 @@ func (pconf *Path) validate(
406410
407411 case strings .HasPrefix (pconf .Source , "http://" ) ||
408412 strings .HasPrefix (pconf .Source , "https://" ):
409- u , err := gourl .Parse (pconf .Source )
413+ u , err := url .Parse (pconf .Source )
410414 if err != nil {
411415 return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
412416 }
413417
414- if u .Scheme != "http" && u .Scheme != "https" {
415- return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
416- }
417-
418418 if u .User != nil {
419419 pass , _ := u .User .Password ()
420420 user := u .User .Username ()
@@ -454,14 +454,14 @@ func (pconf *Path) validate(
454454 }
455455
456456 case strings .HasPrefix (pconf .Source , "srt://" ):
457- _ , err := gourl .Parse (pconf .Source )
457+ _ , err := url .Parse (pconf .Source )
458458 if err != nil {
459459 return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
460460 }
461461
462462 case strings .HasPrefix (pconf .Source , "whep://" ) ||
463463 strings .HasPrefix (pconf .Source , "wheps://" ):
464- _ , err := gourl .Parse (pconf .Source )
464+ _ , err := url .Parse (pconf .Source )
465465 if err != nil {
466466 return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
467467 }
0 commit comments