Apache 通过nodejs和jsmpeg向uberspace传输视频数据

Apache 通过nodejs和jsmpeg向uberspace传输视频数据,apache,.htaccess,mod-rewrite,mod-proxy,mod-proxy-wstunnel,Apache,.htaccess,Mod Rewrite,Mod Proxy,Mod Proxy Wstunnel,我正在尝试通过nodejs和jsmpeg将视频数据流到uberspace和从uberspace流出来 我的问题是,我在尝试访问url时得到了404: 在此服务器上找不到请求的URL/receive。 我正在访问的url如下所示: https://stream.mydomain.com/receive 这是我的.htaccess: DirectoryIndex disabled <IfModule mod_rewrite.c> RewriteEngine On RewriteBase

我正在尝试通过nodejs和jsmpeg将视频数据流到uberspace和从uberspace流出来

我的问题是,我在尝试访问url时得到了404:

在此服务器上找不到请求的URL/receive。

我正在访问的url如下所示:
https://stream.mydomain.com/receive

这是我的.htaccess:

DirectoryIndex disabled
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^send/(.*) http://localhost:61624/$1
RewriteRule ^receive/(.*) ws://localhost:61625/$1
</IfModule>
目录索引已禁用
重新启动发动机
重写基/
重写规则^send/(*))http://localhost:61624/$1
重写规则^receive/(*)ws://localhost:61625/$1
这里有两件事

1) 此规则
RewriteRule^receive/(*)ws://localhost:61625/$1
/receive/xxx
上的匹配,在
receive
后面有一个尾随斜杠(
xxx
部分为可选)。因此,在您的案例中,您至少需要访问
/receive/
。这是你所期望的吗?如果没有,简单地调整你的规则

2) 两个规则都需要使用
mod_proxy
(使用
p
标志)


但是请注意,这种方法并不是最快的。如果可能的话,在apache配置中使用
ProxyPass
ProxyPassReverse
,而不是htaccess。

谢谢你的回答,我会试试。我现在得到了500,但这似乎是另一个问题。不管怎样,你的回答对我帮助很大。再次感谢。事实证明uberspace还不支持WebSocket。
RewriteRule ^send/(.*)$ http://localhost:61624/$1 [P]
RewriteRule ^receive/(.*)$ ws://localhost:61625/$1 [P]