Warm tip: This article is reproduced from serverfault.com, please click

webrtc-如何在Ant Media Server中设置SameSite属性?

(webrtc - How to set SameSite attribute in Ant Media Server?)

发布于 2020-12-13 14:05:53

我正在其中一个流媒体项目中使用Ant Media Server。我需要SameSite=none在Ant Media Server中进行设置你能告诉我怎么做吗?

Questioner
faraway
Viewed
0
Selim Emre Toy 2020-12-13 23:05:11

你需要通过设置SameSite属性context.xml默认情况下,context.xml文件位于/usr/local/antmedia/webapps/{APP}/META-INF/context.xml

添加以下行以将设置SameSitenone

<CookieProcessor sameSiteCookies="none" className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"/>

然后,你的context.xml文件应如下所示:

<Context>
  <Resources allowLinking="true" cacheTtl="500" className="io.antmedia.webresource.StreamWebRoot"/>
  <CookieProcessor sameSiteCookies="none" className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"/>
</Context>

请注意SameSite=none访问安全内容时可以使用的注意事项换句话说,你需要使用HTTPS。

有关其他SameSite值,请访问https://tomcat.apache.org/tomcat-8.5-doc/config/cookie-processor.html

要了解有关SameSite属性的更多信息,请访问以下链接 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite