I've seen the video below on how to install Squid , but in the official doc I can't see how do I access a remote video in HTML using Squid.
I suppose I need to create a node but not sure how, and how do I reference it in my script:
HTML
<video id="fplayer" class="video-js vjs-default-skin"
class="video-js"
controls
preload="auto"
width="640"
height="264"
data-setup="{}"
>
<p class="vjs-no-js">
Please enable JavaScript ..</a>
</p>
<source src="my/vps/path/to/squid/node/myfile.mp4" type="video/mp4" />
// myfiles.mp4 is actually hosted here: mediafire.com/files/myfile.mp4
</video>
https://wiki.squid-cache.org/ConfigExamples ** Squid Doc
https://www.youtube.com/watch?v=C7BobNN4UJg ** SSH Install
Many thanks
I think Squid is not the right proxy to achieve what I need.
Express JS is a better tool, and can route the request to stream a video available in the server.
To stream a video from a remote server (eg.mediafire.com) we need to have access to the HTTP Headers (eg. mediafire.com) , which they're not willing to provide.
Related
I have a problem with storage.
How can I get a file from storage without symlink ?
When I try to get a video from file storage, to HTML video tag, I got a "forbidden" or "Not allowed to load local resource".
Controller :
$url = Storage::url($file);
return view('video')->with('url',$url);
HTML tag :
<video width="600" height="400" controls>
<source src="{{url($url)}}" type="video/mp4">
Your browser does not support the video tag.
Votre navigateur ne supporte pas le lecteur vidéo.
</video>
The idea of the storage is that it may reside in a place not accessible by your webserver, or at least nooit publicly accessible. It could be a folder, it could be an S3 storage, could be something else.
What you need to do is define a route to specifically download the video file. You can generate a temporary signed URL to that route in your controller code: https://laravel.com/docs/7.x/urls#signed-urls
Sent that signed URL to the view. Now the browser will load the video from the signed URL. You need to create the route and controller function to load the file from storage and sent it to the browser: https://laravel.com/docs/7.x/filesystem#downloading-files
I can't read JS variables across frames in a LOCALLY stored HTML frameset
The "same origin" policy fires even when one declares a variable in a locally stored frameset (e.g. in the htm page that defines the frameset = the "parent"). When trying to access this variable from a frame, there is a "permission denied on cross-origin object" error. This happens with Firefox, while Internet Explorer has no objections.
Now this is clearly not a "cross-origin object". I think it is a bug in Firefox. It ruined an application that I wrote that we distributed on many CDRs to customers. The application relied on reading those Javascript variables across a local frameset. I wonder if there is a way to make it work again. Help would be much appreciated.
Examples: unfortunately, this only applies to locally stored files so I can't demonstrate it. You'd have to store the three files locally to see the problem.
Here are my example files online:
http://mpeters.de/temp/frameset/sameorigin_frameset.htm
But as I said, it works here in the online version.
What happens in the "parent" file:
<script>var parentvar='hello';</script>
<frameset>
<frame name="frame1" src="sameorigin_frame1.htm">
<frame name="frame2" src="sameorigin_frame2.htm">
</frameset>
In the "frame1" frame:
<script>var frame1var=parent.parentvar;alert(frame1var);</script>
Loading the frameset as a local file leads to an error in Firefox.
The frame should read and display the variable from the parent file. In MSIE, it does. In Firefox, I get "SecurityError: Permission denied to access property "parentvar" on cross-origin object"
Browsers have settings to turn on / off cross-origin policy. You can try CORS Anywhere or one of the other add-ons for FireFox to allow all cross-origin traffic.
The second option is to put your files under IIS or nginx or httpd and not load them as local files if that's what you're doing.
The third is to not try and get the variable, but create a global function on the parent named something like getMyVar() that returns the variable value and call the function from the frame using parent.getMyVar(). This works in FireFox:
parent.html
<html>
<head></head>
<script>var parentvar='hello';
function getParentVal() { return parentvar; }
</script>
<frameset cols="50%,50%">
<frameset rows="100,300">
<frame name="frame1" src="child.html">
<frame name="frame2" src="child.html">
</frameset>
</frameset>
</html>
child.html
<html>
<head></head>
<body style="background-color:red;">
<script>
var frame1var=parent.getParentVal();document.write(frame1var);
</script>
</body>
</html>
The github repo does not mention any thing on how to use the self hosted server work with AMP . They have given an endpoint to access after storing the request in the server:
/openrtb2/amp?tag_id={ID} //id is the file name of request stored.
I do get the empty targeting response(since server is on local setup).But how will this data reach the amp page? where should this endpoint be requested?
I read in AMP docs that user generated js doesn't work in AMP. I also setup rtc config on amp ad tag and adding vendor as per vendor config(callout-vendor.js)which sends request to the bidder's prebid server url. For example:
If i add appnexus in rtc-config vendors, the request is getting sent to:
https://prebid.adnxs.com/pbs/v1/openrtb2/amp?tag_id={id of tag}
How do i make the request to go to self hosted prebid server url
ok, figured this thing out..
Doc reference: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/rtc-publisher-implementation-guide.md#setting-up-rtc-config
So, first we make an amp-ad tag wherein we have rtc-config attribute. Since, we are using our own server, we'll need to add it in url property as mentioned in that example in doc.
<amp-ad width="320" height="50"
type="network-foo"
data-slot="/1234/5678"
rtc-config={"urls":["our-server-url"]}>
</amp-ad>
The targeting data returned by server will be fetched by amp-ad tag and will be appended to adserver request.
Additionally, we can make a pull request to amphtml repo on github to add our server url in callout-vendor.js file
file reference: https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/0.1/callout-vendors.js
Then, the amp-ad tag will look like this:
<amp-ad width="320" height="50"
type="network-foo"
data-slot="/1234/5678"
rtc-config={"vendors": {"serverAliasAsSetInCalloutVendorFile": {"MACRO1": "MacroValue"}}>
</amp-ad>
We have developed an application which is running perfectly fine on desktop and mobile web with verisign certificate (https). We have developed iOS and android cordova application which was working fine with http server. For production they have enabled SSL. The iOS and android hybrid applications are not working fine because of ajax call response. The following response I am receiving for both http and https. Is there any changes required in client side or its all about SSL? Is there any workaround for SSL decoded response? We are using IBM's websphere application server.
Response from http server
[{"SALT":"3FzekTIywrmm9jojnfHn11"}]
Response from https server
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1"></head><body>
<script type=text/javascript>
function decode_base64(input){
var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output="";
var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9+/=]/g,"");
while(i<input.length){
enc1=keyStr.indexOf(input.charAt(i++));
enc2=keyStr.indexOf(input.charAt(i++));
enc3=keyStr.indexOf(input.charAt(i++));
enc4=keyStr.indexOf(input.charAt(i++));
chr1=(enc1<<2)|(enc2>>4);
chr2=((enc2&15)<<4)|(enc3>>2);
chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){
output=output+String.fromCharCode(chr2)
}
if(enc4!=64){
output=output+String.fromCharCode(chr3)}}return output;
}
document.write(decode_base64("PHNjcmlwdCB0eXBlPXRleHQvamF2YXNjcmlwdD52YXIgdG9fZGVjPWRlY29kZV9iYXNlNjQoImNtUjFWV2hzWkc1MGRTbG5kRzlpZFdodWJ5RXBLSG9oWlc1aWRHeGtiM1V2Ylc1aVlIVm9ibTg4SXk0eGUzRnZMaU02SVh3dElUQXhNVEVvIik7IGRlY19yZXM9IiI7IHZhciB4b3Jfa2V5PTE7IGZvcihpPTA7aTw2MDtpKyspeyBkZWNfcmVzKz1TdHJpbmcuZnJvbUNoYXJDb2RlKHhvcl9rZXledG9fZGVjLmNoYXJDb2RlQXQoaSkpO30gZXZhbChkZWNfcmVzKTs8L3NjcmlwdD4="));
</script>
</body>
</html>
That is quite odd way to return the error message, but your HTTPS server is telling
i18n-values: Missing value for "primaryParagraph"
You can see that by
copy-paste the HTML to text editor,
Name it like foo.html,
Open it on browser,
Open developer tools and see console where it says that.
To answer your question: from point of view of client-side coding there isn't really much difference between HTTP and HTTPS calls. Browser tends to hide those quite effectively, though the performance is in general weaker on HTTPS calls etc.
need some advice/help here.
I just started using the Recaptcha library of ASP.NET from this link
I've followed the simple guide on that page and it worked well with localhost deployment and development.
However, after I moved the same simple page with Recaptcha to my company's server to test the page out, I hit the below exception when trying to validate the recaptcha word.
The operation has timed out
I suspect it has something to do with SSL but my company's website
that I browse, isn't using https, it is just http. I have tried both
methods, having the recaptcha to set OverrideSecureMode to "true" - it
didn't work, set it to false, it didn't work as well (such as below)
<recaptcha:RecaptchaControl
ID="recaptchaControl1" runat="server"
OverrideSecureMode="True"
PublicKey="My_Public_Key"
PrivateKey="My_Private_Key"
/>
My code behind, I'm just using a simple button to invoke and display a
text which work on localhost in Visual Studio:-
if (Page.IsValid)
{
// do the stuff
}
else
// show the error message from recaptcha
What can I do to fix this issue?? Please help.
Sounds like a problem with firewall settings on your company servers. reCAPTCHA requires port 80 outbound (not inbound) to Google servers.