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

hello, consider add my changes in your repo #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

khaliullov
Copy link

added following features:
allow to specify stream genre, url, title, description when relaying, also possibe to change user-agent for single relay
also I have added support for X-Forwarded-For header for correct show stats behind frontend, such as nginx or apache.

expample nginx.conf:
location /rr_128 {
add_header Server "Icecast 2.3.0 by karlheyes";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://192.168.1.158:8000/rr_128;
}
Sample icecast.xml

<relay>
    <server>online.radiorecord.ru</server>
    <port>8101</port>
    <user-agent>WinampMPEG/5.62, Ultravox/2.1</user-agent>
    <stream-name>Radio Record</stream-name>
    <stream-description>First Dance Radio in Russia</stream-description>
    <stream-url>http://localix.ru/</stream-url>
    <genre>Dance</genre>
    <mount>/rr_128</mount>
    <local-mount>/rr_128</local-mount>
    <on-demand>1</on-demand>

    <relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>

@karlheyes
Copy link
Owner

The x-forward-for is handled. You specify a in with the IP of the proxy. This will change the IP internally so that it appears in stats and access logs. You don't want to do this for any incoming IP as headers are easily faked, which is why the tag requires the proxy IP.

As for the other patch, for adding the relay request headers. I could see an argument for setting the user agent, but can you give any reasoning for the others? Sending the name, description, url and genre seems counter-intuitive. What would a master server do with them?

karl.

…ehind"

This reverts commit 30ade61.
already correctly implemented by tags <x-forwarded-for> in <icecast><paths>
@khaliullov
Copy link
Author

yes, x-forwarded-for tag works fine! thank you! reverted that commit.
"user-agent" is used when relay connection created to master. some server blocks icecast (so gready).
response headers after parsing are saved in relay->parser->vars; url, genre, title, desc are added/replaced if they were specified in relay config and icy-headers are sent to client not to master.

@karlheyes
Copy link
Owner

I wonder whether that should be a option thing instead (handled in source_apply_mount function). The mount options have those options which apply to both relays and source clients, but one thing they didn't do is set the parser settings which is what you are doing here. The only advantage I see doing it here is just that you don't have to define a block as well as if you have a

karl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants