Index: applications/editors/josm/plugins/remotecontrol/.project
===================================================================
--- applications/editors/josm/plugins/remotecontrol/.project	(revision 22467)
+++ applications/editors/josm/plugins/remotecontrol/.project	(revision 22472)
@@ -4,4 +4,5 @@
 	<comment></comment>
 	<projects>
+		<project>JOSM</project>
 	</projects>
 	<buildSpec>
Index: applications/editors/josm/plugins/remotecontrol/CONTRIBUTION
===================================================================
--- applications/editors/josm/plugins/remotecontrol/CONTRIBUTION	(revision 22467)
+++ applications/editors/josm/plugins/remotecontrol/CONTRIBUTION	(revision 22472)
@@ -1,2 +1,6 @@
 Originally developed by Frederik Ramm <frederik@remote.org>. Add yourself
 if you contribute.
+
+Stephan Knauss <osm@stephans-server.de>:
+   added /version command to return protocol version
+   added CORS headers for modern browsers, legacy browsers can use jsonp
Index: applications/editors/josm/plugins/remotecontrol/build.xml
===================================================================
--- applications/editors/josm/plugins/remotecontrol/build.xml	(revision 22467)
+++ applications/editors/josm/plugins/remotecontrol/build.xml	(revision 22472)
@@ -28,5 +28,5 @@
 	
 	<!-- set before publising -->
-	<property name="commit.message" value="Changed the constructor signature of the plugin main class" />		
+	<property name="commit.message" value="Added version info capable of jsonp. Also made header CORS aware" />		
 	<property name="plugin.main.version" value="2830" />
 	
Index: applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 22467)
+++ applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 22472)
@@ -43,4 +43,11 @@
 public class RequestProcessor extends Thread
 {
+	/**
+	 * RemoteControl protocol version.
+	 * Change minor number for compatible interface extensions. Change major number in case of incompatible changes.
+	 */
+	public static final String PROTOCOLVERSION = "{\"protocolversion\": {\"major\": 1, \"minor\": 0}, \"application\": \"JOSM RemoteControl\"}";
+
+	
     /** The socket this processor listens on */
     private Socket request;
@@ -80,4 +87,7 @@
         try
         {
+			String content = "OK\r\n";
+			String contentType = "text/plain";
+			
             OutputStream raw = new BufferedOutputStream( request.getOutputStream());
             out = new OutputStreamWriter(raw);
@@ -278,9 +288,15 @@
                 }
                 // TODO: select/zoom to downloaded
-            }
-            sendHeader(out, "200 OK", "text/plain", false);
-            out.write("Content-length: 4\r\n");
+            } else if (command.equals("/version")) {
+				content = RequestProcessor.PROTOCOLVERSION;
+				contentType = "application/json";
+				if (args.containsKey("jsonp")) {
+					content = args.get("jsonp")+ " && " + args.get("jsonp") + "(" + content + ")";
+				}
+			}
+            sendHeader(out, "200 OK", contentType, false);
+            out.write("Content-length: "+content.length()+"\r\n");
             out.write("\r\n");
-            out.write("OK\r\n");
+            out.write(content);
             out.flush();
         }
@@ -409,4 +425,5 @@
         out.write("Server: JOSM RemoteControl\r\n");
         out.write("Content-type: " + contentType + "\r\n");
+		out.write("Access-Control-Allow-Origin: *\r\n");
         if (endHeaders)
             out.write("\r\n");
