Micronaut CLI behind a HTTP proxy

梦想的初衷 提交于 2019-12-14 02:04:33

问题


I'm new to Micronaut, and Gradle for that matter, and I was able to get it to work on my personal laptop. But I wanted to get a POC working for work which is behind a HTTP proxy.

I've been looking for some examples on how to configure Micronaut to be able to work properly behind it. Can anybody point me to some docs or examples to show how this is done?

P.S. I've been trying to get some Gradle examples into an init.d directory in Micronaut hoping it would pick it up but I haven't gotten it to work yet.


回答1:


If your problem is only with the proxy, you can search for how to configure a proxy for a java project - you will find tons of resources. For instance this SO question might help: How do I set the proxy to be used by the JVM




回答2:


I did an

export MN_OPTS="-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3128 -Dhttp.proxyUser=test -Dhttp.proxyPassword=test"

analog to

export GRAILS_OPTS="-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3128 -Dhttp.proxyUser=test -Dhttp.proxyPassword=test"

http://docs.grails.org/latest/guide/conf.html#proxyConfig

It's undocumented in micronaut but it worked for me on RC1

Good luck


correction: It is in the sources

https://github.com/micronaut-projects/micronaut-core/blob/master/src/main/docs/guide/cli/proxy.adoc

https://github.com/micronaut-projects/micronaut-core/commit/63e18d8d3

It's just not yet in the generated docs



来源:https://stackoverflow.com/questions/50672417/micronaut-cli-behind-a-http-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!