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

refer_publish doesn't seem to be working #735

Closed
Laizhongsheng opened this issue Jan 10, 2017 · 5 comments
Closed

refer_publish doesn't seem to be working #735

Laizhongsheng opened this issue Jan 10, 2017 · 5 comments
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@Laizhongsheng
Copy link

Laizhongsheng commented Jan 10, 2017

Hi Winlin,
I am using the restriction of "refer_publish" for testing in a local area network, but it seems that it is not working.

The configuration is as follows: IP is 10.10.10.100, and there is a machine T1 for internal streaming, using FMLE for streaming.

vhost __defaultVhost__ {
    refer_publish 10.10.10.100;  
}

In different versions of SRS, the phenomenon is slightly different:

  1. In the stable version SRS-CentOS6-x86_64-2.0.223.zip, when I change the IP address of T1 to 10.10.10.100 or 10.10.10.99, reconnect and start streaming, everything works fine without restricting the client.

  2. If using source code compilation, git clone https://github.com/ossrs/srs,
    A. Changing the IP address of T1 to 10.10.10.100 allows streaming.
    B. Disconnecting the stream and changing the IP address of T1 to 10.10.10.99 results in failure to connect (displaying connection failed).
    C. Changing the IP address of T1 back to 10.10.10.100 also results in failure to stream, displaying connection failed.

What went wrong?
Thank you.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 11, 2017

The source code is SRS3. You need to checkout the 2.0release branch. Can you please tell me how to use Git with Baidu? I will take another look at the SRS2 issue.

TRANS_BY_GPT3

@winlinvip winlinvip added this to the srs 2.0 release milestone Jan 11, 2017
@winlinvip
Copy link
Member

winlinvip commented Jan 11, 2017

SRS2 is working.


[2017-01-11 09:39:23.322][trace][76230][107] connect app, tcUrl=rtmp:https://127.0.0.1:1935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, args=null
[2017-01-11 09:39:23.323][trace][76230][107] client identified, type=fmle-publish, stream_name=livestream, duration=-1.00
[2017-01-11 09:39:23.346][trace][76230][107] source url=/live/livestream, ip=127.0.0.1, cache=1, is_edge=0, source_id=-1[-1]
[2017-01-11 09:39:23.346][error][76230][107][35] check refer failed. ret=2015(Resource temporarily unavailable)
[2017-01-11 09:39:23.346][error][76230][107][35] check publish_refer failed. ret=2015(Resource temporarily unavailable)
[2017-01-11 09:39:23.346][error][76230][107][35] stream service cycle failed. ret=2015(Resource temporarily unavailable)

Configuration:

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8080;
}
vhost __defaultVhost__ {
    refer_publish winlin.cn;
}

I am using FFMPEG for streaming.

ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy -f flv -y rtmp:https://127.0.0.1/live/livestream

The refer for FMLE streaming is also empty, just like FFMPEG. You can give it a try.

BTW: There is an issue with the configuration parsing of SRS3, I will fix it.

TRANS_BY_GPT3

@winlinvip winlinvip added the Bug It might be a bug. label Jan 11, 2017
@winlinvip winlinvip modified the milestones: srs 3.0 release, srs 2.0 release Jan 11, 2017
@winlinvip
Copy link
Member

winlinvip commented Jan 11, 2017

This 'refer' restriction is limited to PageUrl, not IP. If you want to restrict IP, you need to use security configuration.

TRANS_BY_GPT3

@Laizhongsheng
Copy link
Author

Laizhongsheng commented Jan 11, 2017

In the log, I saw that the refer was empty. In version 3.0, it can indeed be restricted sometimes, but sometimes it doesn't work. I will verify it carefully again.

I couldn't find the configuration for security in the wiki.

TRANS_BY_GPT3

@Laizhongsheng
Copy link
Author

Laizhongsheng commented Jan 11, 2017

I found the configuration in the conf directory, the Security configuration, and it is indeed useful.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 18, 2021
@winlinvip winlinvip changed the title refer_publish似乎不起作用 refer_publish doesn't seem to be working Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

2 participants