简体   繁体   English

通过 nodejs 和 jsmpeg 将视频数据传入和传出 uberspace

[英]Streaming video data to and from uberspace via nodejs and jsmpeg

I am trying to stream video data to and from uberspace via nodejs and jsmpeg.我正在尝试通过 nodejs 和 jsmpeg 将视频数据传入和传出 uberspace。

My problem is that I'm getting a 404 when trying to access the url:我的问题是我在尝试访问 url 时收到 404:

The requested URL /receive was not found on this server.

The url I am accessing is like this: https://stream.mydomain.com/receive我访问的网址是这样的: https://stream.mydomain.com/receive : https://stream.mydomain.com/receive

and this is my .htaccess:这是我的.htaccess:

DirectoryIndex disabled
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^send/(.*) http://localhost:61624/$1
RewriteRule ^receive/(.*) ws://localhost:61625/$1
</IfModule>

Two things here.这里有两件事。

1) This rule RewriteRule ^receive/(.*) ws://localhost:61625/$1 matches on /receive/xxx with a trailing slash after receive ( xxx part as optional). 1)该规则RewriteRule ^receive/(.*) ws://localhost:61625/$1上的匹配/receive/xxx与后尾部斜杠receivexxx部分为可选)。 So you need to access at least /receive/ in your case.因此,在您的情况下,您至少需要访问/receive/ Is it what you expect ?这是你所期望的吗? If not, simply adapt your rules.如果没有,只需调整您的规则。

2) You need to use mod_proxy for both rules (use of the P flag) 2)您需要为这两个规则使用mod_proxy (使用P标志)

RewriteRule ^send/(.*)$ http://localhost:61624/$1 [P]
RewriteRule ^receive/(.*)$ ws://localhost:61625/$1 [P]

Note, though, that this method is not the fastest.但请注意,这种方法并不是最快的。 If possible, use ProxyPass and ProxyPassReverse inside your apache config instead of an htaccess.如果可能,请在 apache 配置中使用ProxyPassProxyPassReverse而不是 htaccess。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM