CEF 3 Disable WebRTC - Ip leaks - webrtc

Can we disable WebRTC in CEF 3 ?
I`m referring specifically to JavaScript access to local ips.
Chrome seems to have settings like chrome.privacy.network.webRTCMultipleRoutesEnabled that help - but these do not seem to exist in CEF.

I had same problem and ended up rebuilding CEF and Chrome without WebRTC support. Here is steps, which I use:
Download automate-git.py script in c:/code/automate folder from here: https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py
Create batch with following content and run it:
SET GYP_MSVS_VERSION=2015
python c:/code/automate/automate-git.py --verbose-build --download-dir=C:/code/chromium_git --branch=[REPLACE WITH CURRENT BRANCH] --minimal-distrib --no-debug-build --force-build
pause
Set enable_webrtc to 0 inside C:\code\chromium_git\chromium\src\build\common.gypi file.
Run batch again.
And maybe there there is easier way, for example, using CefRequestContext::SetPreference.

Related

Changing default path for Chrome executable for karate-chrome

I am using the Karate framework to do the API testing. As part of CI efforts, we send an email at the end of test execution listing the summary of test results. There is a need to include the screeshot of the test execution counts from 'overview-feature.html' file.
I did so through the TestRunner.java file - launched Chrome using Chrome.start() and then using it to take screenshot. It all works well locally on Windows.
However when executing on CI server which is a Unix box, the chrome executable is not present in the default location (usr/bin/google-chrome) and hence the connection for the localhost fails.
Is there a way we can change the default location of the chrome executable?
PS: Apologies if this was too trivial to be asked.
Yes Chrome on CI is hard to get right, refer: https://stackoverflow.com/a/62325328/143475 - note that CI boxes typically are "headless" a browser may not be even installed.
I think the best thing for you is to ZIP the HTML and send it. But I really think you need to work with some CI experts, because the report generation and e-mailing business is normally done by things like Jenkins. What you are doing is certainly not normal or best-practice.
If you really want, there is a Karate Docker container that can give you a proper Chrome instance (see docs) but that is overkill for what you need.
EDIT: The Chrome Java API allows for customization of the executable path and this is in the docs: https://github.com/intuit/karate/tree/master/karate-core#chrome-java-api
It should be something like this:
Chrome.start("/opt/blah/chrome");

Elm install always fails with "ConnectionTimeout" error (in WSL)

I'm new to Elm. and I'm not good at English. So, if any ambiguous or wrong thing is there, please let me correct it.
----------- edit -----------
All my problem below is on WSL. when I'm trying on windows, all work fine. then... why elm install doesn't work on WSL? did you have any idea?
-------- problem --------
when I try to elm-test init, it doesn't work like below
$ elm-test init
Here is my plan:
Add:
elm/random 1.0.0
elm-explorations/test 1.2.2
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0, so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
but my Browser(Chrome) is working beautifully, and even in WSL (the environment that I run elm-test init command at) is too.
$ curl https://github.com/elm/random/zipball/1.0.0/
https://codeload.github.com/elm/random/legacy.zip/1.0.0<body>You are being redirected.</body></html>
then I also try again to redirect the URL
$ curl https://codeload.github.com/elm/random/legacy.zip
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
I think there's no Network Problem. My PC can connect with the repo, and I think it will be downloaded well.
I lastly tried just elm install, and that throws the same error too. it seems like Elm can't connect with the repo, even if My PC can.
$ elm install elm/random
Here is my plan:
Add:
elm/random 1.0.0
Would you like me to update your elm.json accordingly? [Y/n]:
-- PROBLEM DOWNLOADING PACKAGE -------------------------------------------------
I was trying to download the source code for elm/random 1.0.0, so I tried to
fetch:
https://github.com/elm/random/zipball/1.0.0/
But my HTTP library is giving me the following error message:
ConnectionTimeout
Are you somewhere with a slow internet connection? Or no internet? Does the link
I am trying to fetch work in your browser? Maybe the site is down? Does your
internet connection have a firewall that blocks certain domains? It is usually
something like that!
Please help me, what should I do?
I recently had reason to use WSL for elm development. It wasn't much fun and I'm glad to be back on Mac! What I found was that certain disk operations on WSL seemed to go very slowly and that could lead a variety of weird issues.
I was using Webstorm, which does not handle WSL well, so in the end I did everything on C: drive (rather than in /home/...) so that webstorm could run the windows version of elm-format, while my node development environment was run on the linux layer.
That's not a precise answer to your question but just to say that it can be done, but its not an ideal way to write Elm code in my experience
I had same issue and it was solved.
It was due to DNS server settings.
Create a file /etc/resolv.conf and write the following line.
nameserver 8.8.8.8
Then WSL will refer to Google Public DNS and works fine.
However, when restart WSL, the settings revert back.
Therefore, the following settings are also required.
Create a file /etc/wsl.conf and write the following line.
[network]
generateResolvConf = false
wsl --shutdown and restart WSL.
Reference link
https://github.com/microsoft/WSL/issues/4285#issuecomment-522201021

LInephone source code not working with TCP for local SIP calls

I downloaded the source code of Linphone app from GitHub (https://github.com/onmyway133/linphone-iphone) and tried to run it on my iPhone. It is working fine with transport selected as UDP but when I select transport setting as TCP outgoing works fine but the app don't notify about any incoming call.
I also tried to track the network calls by installing Linphone for mac on my macbook but for TCP it not even start any session of network requests.
Any one faced such issue or is there any other way to achieve SIP calling in local network? Any help is welcome.
The source code at the URL mentioned in the question "https://github.com/onmyway133/linphone-iphone" is not latest one. I had to check out the latest version from git url mention at linphone.org and after trying it many times finally I got the complete code and also I had to do few changes to compile the latest source code successfully.
I faced this error while compiling the code on terminal:
Shell script 'Makefile' at path 'linphone-iphone/submodules/build-i386-apple-darwin/mssilk/sdk' was downloading corrupt SILK_SDK_SRC_v1.0.9.zip.
Fix: System terminal was downloading only 600Kbs of file size (i.e. corrupt zipped file) from the URL http://developer.skype.com/silk/SILK_SDK_SRC_v1.0.9.zip due to which next command was not able to unzip it and was displaying file missing error. I changed the default URL to 'http://bkvoice.googlecode.com/files/SILK_SDK_SRC_v1.0.9.zip' thus process was able to download the file that was actually 62.9MBs of size.
Hope it'll help someone.

Waiting for file to download on selenium grid

I have a test using Webdriver and C# which downloads a file from a website.
When running this test on my local machine it works fine but when I try to run it on Selenium grid it Looks for the file I'm downloading on the hub and not on the node.
Is the anyway of accessing the node file structure to monitor when the file is downloaded.
Sorry if this is unclear.
Thanks
Aidan
It seems, there is no such possibility.. I have also tried to find such functionality, but failed.
But, one way to check it still exists - "upload downloaded". Of course it is workaround and not always you have such function as upload.
Anyway, you may:
download test data
delete test data from page
upload test data on page again
check it was really appeared
It is quite dirty way, but on other hand it allows you to test not only download function, but also upload function.

Detect file in use by other process

On windows and such I used to use a trick to find out of a file is currently in use (written specifically).
I use to open the file for writing and if it failed most likey another process is busy accessing it.
Sadly these trick (using C OPEN with exclusive lock for writing) doesn't work on my Mac. While my curl in a terminal is still writing my -fileBusy() check fails.
fcnt call on the fd with F_GETLK doesn't reveal any locking as well.
Is there any chance for me to detect if a file is in use by another process?
Ps> listening for fsevents can't be done because my app launches after the is created by the other app / process.
Apple confirmed via email that the solution described in the link below is a valid one and not considered a private API.
More information:
http://lists.apple.com/archives/cocoa-dev/2010/May/msg01455.html
You could try running the following shell command using NSTask:
lsof -Fc path/to/thefile
That will give you the process ID and name of any process(es) that have thefile open.