Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visit HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv, why doesn't it work? #1255

Closed
zhuwh1118 opened this issue Nov 1, 2018 · 11 comments
Assignees
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Milestone

Comments

@zhuwh1118
Copy link

zhuwh1118 commented Nov 1, 2018

Taking the streaming server IP as an example, it is 192.168.1.170.
FMS URL: rtmp://192.168.1.170/live?vhost=push
Stream: livestream

Why can't I access HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv?

Print information:
[2018-11-01 16:12:04.230][warn][4695][117][2] http miss file=./objs/nginx/html/push/live/livestream.flv, pattern=/, upath=/push/live/livestream.flv

Configuration as follows,
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
vhost push {
min_latency on;
gop_cache off;
forward x.x.x.x:1935;
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;

}

}

TRANS_BY_GPT3

@zhuwh1118
Copy link
Author

zhuwh1118 commented Nov 1, 2018

Accessing HTTP FLV: http://192.168.1.170:8080/live/livestream.flv is also not working.

TRANS_BY_GPT3

@sunphonexs
Copy link

sunphonexs commented Dec 25, 2019

Has this problem been resolved later?

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 25, 2019

You used vhost, so the stream goes to that vhost. Accessing the default actually means __defaultVhost__, which of course has no stream. This vhost is designed for isolation, so it cannot be accessed.

TRANS_BY_GPT3

@sunphonexs
Copy link

sunphonexs commented Dec 27, 2019

If there is a vhost, how should the access address for http be constructed?
Previously, when constructing an rtmp address, it could be written as rtmp://..../name?vhost=vhostName. However, when I tried to construct an http address using the same method, it didn't work. How should I modify it?

If you use vhost, the stream will be directed to that vhost. Accessing the default vhost, which is actually __defaultVhost__, will not have any streams. This vhost is meant for isolation, so it cannot be accessed.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 27, 2019

vhost is the domain name, for example, a server serving two clients (domain name or vhost), the configured vhost is:

vhost ossrs.net {
}

There are two ways for this client to access resources:

  1. http://ossrs.net:8080/live/livestream.flv
  2. http://10.11.12.13:8080/live/livestream.flv?vhost=ossrs.net

The second way mentioned above is the server IP and vhost in the parameters.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 27, 2019

rtmp is the same as http, just change the protocol to rtmp. For example:

  1. rtmp://ossrs.net/live/livestream
  2. rtmp://10.11.12.13/live/livestream?vhost=ossrs.net

TRANS_BY_GPT3

@sunphonexs
Copy link

sunphonexs commented Dec 27, 2019

I tried the second method and it didn't work. The first method is not applicable either due to cross-domain issues. We have a separate deployment of nginx, so it doesn't work either.

The vhost refers to the domain name, for example, when a server serves two clients (domains or vhosts), the configured vhost is:

vhost ossrs.net {
}

Then this client can access resources in two ways:

  1. http://ossrs.net:8080/live/livestream.flv
  2. http://10.11.12.13:8080/live/livestream.flv?vhost=ossrs.net

The second way mentioned above is using the server IP and vhost as parameters.

TRANS_BY_GPT3

@sunphonexs
Copy link

sunphonexs commented Dec 27, 2019

Just to add, I am using the current 2.0 version of the code.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 27, 2019

I tried it out, and there is a problem with the last stream. I will fix it in SRS3.

SRS 3.0.90 fixed.

TRANS_BY_GPT3

@winlinvip winlinvip reopened this Dec 27, 2019
@sunphonexs
Copy link

sunphonexs commented Dec 27, 2019

In this case, are there any other methods to view the live streams in the vhost rt.ossrs.net, apart from the second last format (http://rt.ossrs.net:8080/live/livestream.flv)? If possible, please provide a solution based on HTTP FLV.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

Fixed in 3.0.90.

@winlinvip winlinvip self-assigned this Sep 11, 2021
@winlinvip winlinvip added the Won't fix We won't fix it. label Sep 11, 2021
@winlinvip winlinvip added this to the 3.0 milestone Sep 11, 2021
@winlinvip winlinvip changed the title 访问HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv为什么不行呢? Visit HTTP FLV: http://192.168.1.170:8080/push/live/livestream.flv, why doesn't it work? Jul 27, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. Won't fix We won't fix it.
Projects
None yet
Development

No branches or pull requests

3 participants