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

Enable/disable HTTP ingest #1446

Merged
merged 3 commits into from
Apr 14, 2020
Merged

Enable/disable HTTP ingest #1446

merged 3 commits into from
Apr 14, 2020

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Apr 12, 2020

What does this pull request do? Explain your changes. (required)

This PR enables/disables HTTP ingest according to the following rules:

  • HTTP ingest is enabled by default
  • If the HTTP server is publicly accessible (i.e. -httpAddr uses a non-local host) and there is no authentication webhook URL specified then HTTP ingest is disabled
    • In this case, HTTP ingest can be enabled with any of the following:
      • Configure -authWebhookUrl
      • Set -httpIngest

Specific updates (required)

See commit history for a description of each update.

How did you test each of these updates (required)

Updated unit tests and tested manually.

Does this pull request close any open issues?

Fixes #1441

Checklist:

  • README and other documentation updated
  • Node runs in OSX and devenv
  • All tests in ./test.sh pass

@@ -578,6 +585,11 @@ func getRTMPStreamHandler(s *LivepeerServer) func(url *url.URL) (stream.RTMPVide

// HandlePush processes request for HTTP ingest
func (s *LivepeerServer) HandlePush(w http.ResponseWriter, r *http.Request) {
if !s.HTTPIngest {
respondWith400(w, "HTTP ingest is disabled")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably an HTTP 405 "Method Not Allowed" but idk if we observe that sort of thing at all in go-livepeer

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 727d98b

cmd/livepeer/livepeer.go Outdated Show resolved Hide resolved
server/mediaserver.go Outdated Show resolved Hide resolved
cmd/livepeer/livepeer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@j0sh j0sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

@yondonfu yondonfu merged commit 652a069 into master Apr 14, 2020
@yondonfu yondonfu deleted the yf/http-ingest-flag branch April 14, 2020 17:30
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.

Add -httpIngest flag
3 participants