How to convert `git:` urls to `http:` urls

Here’s an example of rewriting the default protocol for GitHub: git config –global url.https://github.com/.insteadOf git://github.com/ The exact values depend on the protocol in use. For example, the above command for git over ssh will look like: git config –global url.https://github.com/.insteadOf git@github.com: Git documentation for url.<base>.insteadOf: git config [–global] url.<base>.insteadOf <other_url> Any URL that starts with … Read more

Difference between the Facade, Proxy, Adapter and Decorator design patterns?

Adapter adapts a given class/object to a new interface. In the case of the former, multiple inheritance is typically employed. In the latter case, the object is wrapped by a conforming adapter object and passed around. The problem we are solving here is that of non-compatible interfaces. Facade is more like a simple gateway to … Read more

Problems using Maven and SSL behind proxy

The answer above is a good working solution, but here’s how to do it if you want to use the SSL repo: Use a browser (I used IE) to go to https://repo.maven.apache.org/ Click on lock icon and choose “View Certificate” Go to the “Details” tab and choose “Save to File” Choose type “Base 64 X.509 … Read more

Using npm behind corporate proxy .pac

I’ve just had a very similar problem, where I couldn’t get npm to work behind our proxy server. My username is of the form “domain\username” – including the slash in the proxy configuration resulted in a forward slash appearing. So entering this: npm config set proxy “http://domain\username:password@servername:port/” then running this npm config get proxy returns … Read more

How to convert a Hibernate proxy to a real entity object

Here’s a method I’m using. public static <T> T initializeAndUnproxy(T entity) { if (entity == null) { throw new NullPointerException(“Entity passed for initialization is null”); } Hibernate.initialize(entity); if (entity instanceof HibernateProxy) { entity = (T) ((HibernateProxy) entity).getHibernateLazyInitializer() .getImplementation(); } return entity; }

NGINX to reverse proxy websockets AND enable SSL (wss://)?

Just to note that nginx has now support for Websockets on the release 1.3.13. Example of use: location /websocket/ { proxy_pass ​http://backend_host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection “upgrade”; proxy_read_timeout 86400; } You can also check the nginx changelog and the WebSocket proxying documentation.

Gradle proxy configuration

Refinement over Daniel’s response: HTTP Only Proxy configuration gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” HTTPS Only Proxy configuration gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” Both HTTP and HTTPS Proxy configuration gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 “-Dhttp.nonProxyHosts=*.nonproxyrepos.com|localhost” Proxy configuration with user and password gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 – Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 -Dhttps.proxyUser=user -Dhttps.proxyPassword=pass -Dhttp.proxyUser=user -Dhttp.proxyPassword=pass -Dhttp.nonProxyHosts=host1.com|host2.com worked for me (with gradle.properties in … Read more

Proxy with express.js

request has been deprecated as of February 2020, I’ll leave the answer below for historical reasons, but please consider moving to an alternative listed in this issue. Archive I did something similar but I used request instead: var request = require(‘request’); app.get(“https://stackoverflow.com/”, function(req,res) { //modify the url in any way you want var newurl=”http://google.com/”; request(newurl).pipe(res); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)