I'm working behind a proxy and I save my code using github.com .
My snippets of java code contain some system parameters to tell java about our proxy:
System.setProperty("http.proxyHost", "xxxxxxxxx");
System.setProperty("http.proxyPort", "1234");
aside from specifying those parameters on the command line or storing them in a config file, is it safe to publish this IP on a public server ? Could a hacker use it to attack my server ?
You should not rely on security by obscurity. It does not make any difference whether you publish this IP or not. There are many people running scans of the whole IPv4 address space for open or vulnerable proxies, so once it's reachable, it will be discovered in a matter of days. As long as the proxy itself is secure, you can publish the address.