How to set Proxy settings for plantuml

0 votes
asked Jun 25 in Question / help by Serge Wenger Work (9,890 points)

Hello,

I try to use https://github.com/Roemer/plantuml-office, but I have the following error:

Preprocessor Error: java.net.ConnectException: Connection refused: connect

I have a proxy in my office. How can I set the proxy address and password?

2 Answers

0 votes
answered Jun 25 by plantuml (188,240 points)
Could you test if the following example are working for you :

java -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8080 -jar plantuml.jar -checkversion    

@startuml
checkversion(proxy=myproxy.com,port=8080)
@enduml

It's just to check if this is working with your proxy. If it is, we may add some news flags to generalize proxy support.
commented Jun 26 by Serge Wenger Work (9,890 points)
Hello,
java -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8080 -jar plantuml.jar -checkversion    
is OK from command line

@startuml
checkversion
@enduml
is OK from command line

@startuml
checkversion(proxy=myproxy.com,port=8080)
@enduml
is not OK from my server. I think username and password are missing
commented Jun 26 by plantuml (188,240 points)
Ok, thanks.

On your server, we could imagine set the proxy in the text diagram itself.
Something like:

@startuml
!pragma http.proxyHost myproxy.com:8080
!include http://foo.com/foo.puml
Alice -> Bob
@enduml

However, this would be an issue for username/password.
I cannot imagine something like:

@startuml
!pragma http.proxyHost myproxy.com:8080
!pragma username serge
!pragma password mySecretPassword
!include http://foo.com/foo.puml
Alice -> Bob
@enduml

I am note sure about the best solution for username/password management.
So any suggestion is welcome!
0 votes
answered Jun 26 by plantuml (188,240 points)

BTW plantuml-office have been integrated into standard library http://plantuml.com/stdlib

Meaning you can now have:

@startuml
!include <font-awesome/common>

!include <office/Servers/database_server>
!include <office/Servers/application_server>
!include <office/Concepts/firewall_orange>
!include <office/Clouds/cloud_disaster_red>

title Office Icons Example

package "Sprites" {
	OFF_DATABASE_SERVER(db,DB)
	OFF_APPLICATION_SERVER(app,App-Server)
	OFF_FIREWALL_ORANGE(fw,Firewall)
	OFF_CLOUD_DISASTER_RED(cloud,Cloud)
	db <-> app
	app <--> fw
	fw <.left.> cloud
}

@enduml

commented Jun 27 by Serge Wenger Work (9,890 points)
Yes, but only sprite, not the images with color like the sample.

I have the workaround with the java -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=8080 -jar plantuml.jar ...
...