Jump to content
  • 0

How do I add(modify) response header from ant-media server??


Kai
 Share

Question

Hi, support team.

My name is Kai.
Let me ask you about response header.

I configured web application in lighttpd using ant-media server.
I need to set COEP and COOP configuration in lighttpd, So I want to add crossorigin info in response header from ant-media server.
However I have no idea how to add them.

How can I modify response header??

Thanks,
Kai

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Hi, support team.

 

Sorry for the continuous posting.

To put it simply, since we are building a Cross-Origin-Isolated site, in order to embed information from the cross-origin site (embed WebRTC video from Ant-Media), the following is in the response header from Ant-Media Server. I want to add.

COEP (Cross-Origin-Embeded-Policy): require-corp
CORP (Cross-Origin-Resource-Policy): cross-origin

Link to comment
Share on other sites

  • 0

Hi, Mohit

Thank you for your reply.

But for my recognition, this is a filter when Ant Media Server receives a request, it doesn't change the reponse header when Ant Media Server returns a response.


I just want to add COEP and CORP information to the "response" from Ant Media as shown in the figure below.
How does this realize?
image.thumb.png.dadda779afec65bda4cdd8c172ffb703.png

Link to comment
Share on other sites

  • 0
On 5/23/2022 at 6:45 AM, Kai said:

Hi, Mohit

Thank you for your reply.

But for my recognition, this is a filter when Ant Media Server receives a request, it doesn't change the reponse header when Ant Media Server returns a response.


I just want to add COEP and CORP information to the "response" from Ant Media as shown in the figure below.
How does this realize?
image.thumb.png.dadda779afec65bda4cdd8c172ffb703.png

Hi @Kai,

How are you!

Thank you again for your detailed response.

I have discussed about these with the team internally and the Lead Developer is looking into it and we will write to you very soon.

Thank you for your kind understanding.

Link to comment
Share on other sites

  • 0

Hi @Kai,

Thank you for your follow ups.

We've made some quick research for that and it seems that we find the same the way as @Connessione recommends.

Thank you so much @Connessione 🙂

@Kai, Please try to use the example link to add header and let us know if you need further help.

Also,Thank you again @Connessione In order to show our appreciation, we would like to have virtual coffee with you 🙂  so May I send a Starbucks gift card to your email?

 

Thank you. 

  • Like 1
Link to comment
Share on other sites

  • 0

Hi, @Connessione and @Mohit.

Thank you for your support.
I see, its good. I will try to use " response header modification in tomcat " and let me know if its OK.

Best Regards,
Kai
 

  • Like 2
Link to comment
Share on other sites

  • 0
On 5/30/2022 at 11:59 AM, Mohit said:

Hi @Kai,

Thank you for your follow ups.

We've made some quick research for that and it seems that we find the same the way as @Connessione recommends.

Thank you so much @Connessione 🙂

@Kai, Please try to use the example link to add header and let us know if you need further help.

Also,Thank you again @Connessione In order to show our appreciation, we would like to have virtual coffee with you 🙂  so May I send a Starbucks gift card to your email?

 

Thank you. 

Unfortunately i am not much of a coffee person here :). But i acknowledge your appreciation all the same. Thank you  😊

  • Like 2
Link to comment
Share on other sites

  • 0

Hi, @Connessione and @Mohit.

I did tried, but it didn't work following below step ..
(WebRTC has disappeared from the menu. Probably this is due to an error in web.xml.

It seems that ResponseHeaderFilter cannot be read from the placed jar file.)
image.png.b98e472921214cd02aab4fcd3acf8079.png

Honestly I don't know in detail about java servlet..
Could you help me ??Do you know what's wrong.

  1. sudo apt update
  2. sudo apt install default-jdk (sudo apt install openjdk-11-jdk)
  3. export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") export PATT=$PATH:$JAVA_HOME/bin
  4. sudo apt install tomcat9
  5. sudo systemctl status tomcat9
  6. create response-header-filter.jar ↓
    1. cd ~/work
    2. git clone https://github.com/Hory314/response-header-filter
    3. sudo javac -classpath /usr/share/tomcat9/lib/servlet-api.jar ResponseHeaderFilter.java
    4. jar -cvf response-header-filter.jar *.class
  7. sudo cp response-header-filter.jar /usr/local/antmedia/lib/
  8. edit web.xml --> sudo vi /usr/local/antmedia/webapps/WebRTCAppEE/WEB-INF/web.xml
  9. sudo systemctl restart antmedia
Edited by Kai
  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...