Open AlJohri opened 5 years ago
hello @AlJohri, if it did work for you please care to share the solution, i need this
examples:
suggestion:
since there is no documentation that describes the shape of the input parameter to this method:
const get_middleware = function(params) {
//...
}
an easy way to configure its value is to:
const get_middleware = function(params) {
console.log(JSON.stringify(params, null, 2))
process.exit(0)
}
now, you can copy the value of your configured params
(as JSON) from the log file,
and use it in your Express.js project (similarly to the examples, above):
const middleware = require('@warren-bank/hls-proxy/proxy')(params)
I tried modifying your code a bit to be able to embed it within an existing express app. I ran into some issues with the regexes not working and ended up rolling my own quick and dirty solution.
Can you help me understand some of the complexity in the proxy code? My implementation below works well for my fairly particular use case (bypassing CORS restriction) but I wanted to better understand how this might fail in more complicated scenarios that your code presumably is built to handle.
P.S. The
m3u8
regex was failing onhttp://11.111.111.111:9999/AajTak/index.m3u8?token=8e55714a60ec4b14a536720df79355ab
. Didn't debug much farther than that.