-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work behind proxy #302
Comments
Hi @briangabriel |
I have no problems with npm, the issue is that the
|
Hi @briangabriel , You are absolutely correct. We are working on adding support for proxy, but meanwhile, can you try one more thing: |
Hi @briangabriel |
Rename the following config options: - FIDDLER_HOSTNAME to PROXY_HOSTNAME - PROXY_TO_FIDDLER to USE_PROXY Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs. Required for NativeScript/nativescript-cli#297 and NativeScript/nativescript-cli#302
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait(). Update common lib, where the following changes are applied: Rename the following config options: - FIDDLER_HOSTNAME to PROXY_HOSTNAME - PROXY_TO_FIDDLER to USE_PROXY Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs. Required for #297 and #302
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait(). Update common lib, where the following changes are applied: Rename the following config options: - FIDDLER_HOSTNAME to PROXY_HOSTNAME - PROXY_TO_FIDDLER to USE_PROXY Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs. Required for #297 and #302
Add config.json file inside new config directory. This file is required in order to allow user specific configurations. Modify nativescript-cli.ts in order to wrap resolving of config and errors inside fiber as the new implementation of config has .wait(). Update common lib, where the following changes are applied: Rename the following config options: - FIDDLER_HOSTNAME to PROXY_HOSTNAME - PROXY_TO_FIDDLER to USE_PROXY Add PROXY_PORT option to config with default value 8888. Add ConfigBase class which should be used as a base for CLI specific configs. Required for #297 and #302
I've tried the version and it doesn't work for me, probably because the port is hard-coded to 8888 (the xxx.xxx.xxx.xxx is really the right IP address, just blanked). I've tried it with just the host IP address and with the IP address and port, the result for both is the same.
|
Hi @Klors |
That's great, I'll try it on Monday thanks. |
That worked perfectly thanks |
Thank you for testing it. As I've said - the same fix will be included in our next release. I'm closing this thread now, but feel free to contact us in case you have any other problems with the configuration. |
I am having the same issue. Exception in thread "main" java.net.ConnectException: Operation timed out |
I'm having the same trouble as @vogatsiko - >tns run android gets to 'Preparing project... , Executing before-prepareJSApp hook.... Gradle clean... and as it attempts to download gradle-4.10.2-all.zip the connection times out. I've placed my proxy config in my gradle.properties file in my /.gradle folder like: systemProp.http.proxyHost=<our.proxy.ip> but even after restarting the CMD window still have this issue (Windows 10). I've searched a bit, but haven't found where gradlew would use a separate properties file though I see people refer to it. Just copying my gradle.properties didn't help, I guess because gradlew is supposed to run standalone apart from an existing install. It seems like poking proxy settings into project specific files is a bad solution though apparently the only way to do this presently? |
Hey @datatribe ,
I remember I've seen gradle failing in case you've added |
Thanks @rosen-vladimirov, I was sure not to include http://. I tried your suggestion to debug and got some interesting results. The build failed the first two times with a lot of stack trace output, so I piped the output to a file and I noticed the behavior changed. It no longer said "build failed in 43 seconds". I also have this line in my properties file, added by me as I was troubleshooting: The build now concludes with the following: 12:04:42.072 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'basicdemo'.] from daemon DaemonInfo{pid=21664, address=[69d069a9-e534-4a50-a64f-6c176bf40564 port:54499, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1548953922535, context=DefaultDaemonContext[uid=e6798598-ed1c-4687-8376-b6cb8456ca10,javaHome=C:\Program Files\Java\jdk1.8.0_152,daemonRegistryDir=C:\Users\myid.gradle\daemon,pid=21664,idleTimeout=10800000,daemonOpts=-Xmx16384M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done). |
Apparently piping to an output file isn't a good idea. I notice most of the visible output is missing. |
Hey @datatribe , Also, have you tried cleaning your local gradle cache, the one at |
I traced the problem to the ip address provided for our proxy server. Thanks for your help @rosen-vladimirov - you helped me pinpoint the issue. |
I'm so glad you were able to trace the issue. Happy coding! |
I can install NativeScript via npm with no issues, but there is no way to configure the http-client with the proper proxy settings.
E:\LocalDev\nativescript>tns create hello-world --log trace
Starting watch on killswitch C:\Users\gabrielb\AppData\Local\Temp\gabrielb\KillSwitches\cli
Creating a new NativeScript project with name hello-world and id org.nativescript.helloworld at location E:\LocalDev\nativescript\hello-world
Using NativeScript hello world application
User-Agent: AppBuilderCLI/0.9.1 (Node.js 0.10.28; win32; x64)
httpRequest: { method: 'GET',
host: 'registry.npmjs.org',
port: null,
path: '/tns-template-hello-world',
headers:
{ Accept: 'application/json; charset=UTF-8, /;q=0.8',
'User-Agent': 'AppBuilderCLI/0.9.1 (Node.js 0.10.28; win32; x64)',
'Accept-Encoding': 'gzip,deflate' } }
httpRequest: Sending:
[nothing]
{ [Error: connect ETIMEDOUT] stack: [Getter] }
Error: connect ETIMEDOUT
The text was updated successfully, but these errors were encountered: