summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-01-25 10:05:02 (EST)
committer Steffen Pingel2012-01-25 10:05:02 (EST)
commit4bad08f05a636d5a976cbc030f3c0279f694ffee (patch)
tree2666239bd3a3a8048e45bf6515475115e418904f
parentb60424f6fcf3ed5b030723bd3cfc2226445ba4a8 (diff)
downloadorg.eclipse.mylyn.commons-4bad08f05a636d5a976cbc030f3c0279f694ffee.zip
org.eclipse.mylyn.commons-4bad08f05a636d5a976cbc030f3c0279f694ffee.tar.gz
org.eclipse.mylyn.commons-4bad08f05a636d5a976cbc030f3c0279f694ffee.tar.bz2
RESOLVED - bug 351100: fix address of local proxy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351100 Change-Id: I6a7ce10e3d03fbb26ab2be6a2ad0d2099e4ffba9
-rw-r--r--org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestProxy.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestProxy.java b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestProxy.java
index ac8702e..915d1bb 100644
--- a/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestProxy.java
+++ b/org.eclipse.mylyn.commons.sdk.util/src/org/eclipse/mylyn/commons/sdk/util/TestProxy.java
@@ -20,8 +20,10 @@ import java.io.InputStreamReader;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
@@ -321,7 +323,13 @@ public class TestProxy implements Runnable {
}
public String getUrl() {
- return "http://" + serverSocket.getInetAddress().getHostAddress() + ":" + serverSocket.getLocalPort();
+// InetSocketAddress address = new InetSocketAddress("localhost", serverSocket.getLocalPort());
+// return "http://" + address.getHostName() + ":" + address.getPort() + "/";
+ try {
+ return "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + serverSocket.getLocalPort();
+ } catch (UnknownHostException e) {
+ return "http://localhost:" + serverSocket.getLocalPort();
+ }
}
public void stop() {