browscap.xml not working with msnbot and amazonaws bot - browscap

I have used browscap.xml file but its not working with below crawler.
Ip address Host name
1) 35.81.238.115 ec2-35-81-238-115.us-west-2.compute.amazonaws.com
2) 40.77.167.19 msnbot-40-77-167-19.search.msn.com
Can you please help me? How to add this additional name into browscap.xml file.
https://browscap.org/#google_vignette

Related

mac custom localhost with port on file host

i have 2 projects running on different ports
localhost:7240
localhost:6040
I would like to have two custom domains like
website.dev -> that points to localhost:7240
admin.dev -> that points to localhost:6040
My host file
127.0.0.1 website.dev
127.0.0.1 admin.dev
and on browser i tryed those
http://website.dev/
http://website.dev:7240/
but none of them worked :/
but if i write
localhost:7240
localhost:6040
will work.
I apprecite any help. Thanks.
OMG !!
I make it work. Follow those rules.
dont user .dev, use something like .local
127.0.0.1 website.local
On chrome disable the https SSL enforcer
chrome://net-internals/#hsts, add the website.local in the Delete domain security policies1
Clear cache or history data
Vistin http://website.local:7240/ Dont forget the / at the end.

Laravel URL Helper return IP address instead of Domain name

I have a problem when trying to create the Url using URL helper. I'm using Laravel 6.
$verify_url = url("/verify");
This is return the URL with the IP address instead of the domain name.
I don't know if it is a problem with the Apache server or the code.
Please help me. Thanks.
Adding this directive to Apache Virtual Host config seems to have fixed it: ProxyPreserveHost On
But a better way to use your urls is to name them in your routes/web.php. For ex:
Route::post('/verify', 'HomeController#verify')->name('verify');
and wherever you need to access to this url just use like this:
$verify_url = route('verify');

How to get the server IP with Laravel

Using Laravel, I can get the client IP with request()->ip().
Is there a Laravel built-in way to get the server IP? Or is it something "impossible" (same problem as SERVER_ADDRreliability)
You can use request object:
request()->server('SERVER_ADDR');
Or you can use standard PHP way:
$_SERVER['SERVER_ADDR'];
Request::server('SERVER_ADDR') :)
URL Reference: https://laravel.com/api/5.3/Illuminate/Http/Request.html
$_SERVER['SERVER_ADDR']; for server ip
$_SERVER['SERVER_PORT']; for server port
You can use this way on the server.
$_SERVER['SERVER_ADDR'];
But you can not access SERVER_ADDR index locally. It will through Undefined index: SERVER_ADDR error. In my case, I face this error.
A better solution would be using variable from .env file which will work locally and server as well.
Defined a variable in .env file like this. You can give any name you want.
SERVER_ADDR = 127.0.0.1
Note: Please note SERVER_ADDR value should be 127.0.0.1 or localhost to get the server address value.
Now you can access this variable like this:
env('SERVER_ADDR');
If you are using IIS, you can only get the server IP using
$_SERVER['LOCAL_ADDR']
if it is LINUX, use :
$_SERVER['SERVER_ADDR'];
/** Server IP Check **/
if(!isset($_SERVER['SERVER_ADDR']){ $_SERVER['SERVER_ADDR'] = $_SERVER['LOCAL_ADDR']; }
/** Get Server IP **/
!isset($_SERVER['SERVER_ADDR']))?$_SERVER['LOCAL_ADDR']:$_SERVER['SERVER_ADDR']
This also gives you the IP
$request->ip();

Add local file url to allowed domains Firefox : about:config

I am creating a screen sharing addon in Firefox and need to use : media.getusermedia.screensharing" feature.
But since I am working locally using AddOn SDK, my url of opened html file is : resource://jid1-q3wuqdulcvnnrq-at-jetpack/toolbar_button/data/index.html
Now, on this link I get an error :
In about:config, please enable media.getusermedia.screensharing.enabled
and add this site's domain name to media.getusermedia.screensharing.allowed_domains in about:config
Also It requires an https connection.
While the same WebRTC works fine in Chrome extension.
Can someone please guide on how to add local file url to allowed domains? or to use getusermedia for local development.
A search on mxr for screensharing:
http://mxr.mozilla.org/mozilla-release/search?string=screensharing
which led to this whitelist:
http://mxr.mozilla.org/mozilla-release/source/dom/media/MediaManager.cpp#151
So then i checked domains already in this pref, they were: webex.com,*.webex.com,collaborate.com,*.collaborate.com
so when i did this: Services.io.newURI('http://www.webex.com', null, null) i got this:
So it looks like whatever is in host is what we want in this pref. So i tried newURI of file uri:
Services.io.newURI('file:///C:/Users/Vayeate/Documents/GitHub/Profilist/bullet_aurora.png',null,null)
it dumps this:
so im thinking in the the pref add this:
,,
which is a blank space, which is what it looks like it is for file uris
so mine would look like: webex.com,*.webex.com,collaborate.com,,*.collaborate.com
or can even trying just an asterik so like:
webex.com,*.webex.com,collaborate.com,*.collaborate.com,*

Editing HOSTS file for specific URL?

I have tried to edit my HOSTS file to block just a specific url like so:
127.0.0.1 google.com/pagetoblock
127.0.0.1 www.google.com/pagetoblock
However that isn't working.
Does anyone know where I'm going wrong?
Your HOSTS file only allows you to set the IP address for (as the name suggests) the host (e.g. google.com or www.google.com). You cannot set the IP address for specific pages.
You could use a tool like Microsoft Fiddler to set the IP Address for specific URLs, but this would require Fiddler be running continuously.
Fiddler has a rules engine accessed by Rules → Customize Rules.
There is a great set of samples for your learning, but the following script should work.
For example, to block the logo on the http://www.google.co.uk homepage, you could use the following script:
if (oSession.url == "www.google.co.uk/images/srpr/logo3w.png"){
// Prevent this request from going through an upstream proxy
oSession.bypassGateway = true;
// Rewrite the IP address of target server
oSession["x-overrideHost"] = "127.0.0.1";
// Set the color of the request in RED in Fiddler, for easy tracing
oSession["ui-color"]="red"; 
}

Resources