【问题标题】:How to set SameSite attribute in Ant Media Server?如何在 Ant Media Server 中设置 SameSite 属性?
【发布时间】:2020-12-13 23:05:11
【问题描述】:

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

【问题讨论】:

    标签: webrtc streaming ant-media-server


    【解决方案1】:

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

    添加以下行以将SameSite 设置为none

    <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

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 1970-01-01
      • 2018-11-21
      • 2020-07-04
      • 2020-04-25
      • 2020-06-15
      • 1970-01-01
      • 2019-10-31
      • 2019-06-03
      相关资源
      最近更新 更多