title: clojure swank server opens public port?
body: <p>(This question has been downvoted, which I find strange. How have I offended?)</p>
  
  <p>Am I right to think that running a swank server usually opens port 4005 to the world, not bound to localhost-only connections?</p>
  
  <p>So anyone hacking in a café is not only allowing passers-by to execute arbitrary code on their computer, but is giving them a nice interface to do it with.</p>
  
  <p>It appears that when I run a swank server with either 'mvn clojure:swank', or 'lein swank', or (swank.swank/start-server "/tmp/yo")</p>
  
  <p>then I get something like (thanks Mike!):</p>
  
  <pre><code>$lsof -i -P
  java      11693 john   13r  IPv6 6701891      0t0  TCP *:34983 (LISTEN)
  </code></pre>
  
  <p>and indeed I can connect from an emacs running on another machine on the same network.</p>
  
  <pre><code>(swank.swank/start-server "/tmp/yo")
  </code></pre>
  
  <p>If I start the server by hand, it produces the following output</p>
  
  <pre><code>Connection opened on local port  34983
  #&lt;ServerSocket ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=34983]&gt;
  </code></pre>
  
  <p>Whereas:</p>
  
  <pre><code>(swank.swank/start-server "/tmp/yo" :host "localhost")
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>Connection opened on local port  40368
  #&lt;ServerSocket ServerSocket[addr=localhost/127.0.0.1,port=0,localport=40368]&gt;
  </code></pre>
  
  <p>Which seems more like I was expecting.</p>
  
  <p>Is there any good reason for doing this?</p>
  
  <p>Any ideas on how it the more conventional ways of starting it could be persuaded to only accept connections from local processes?</p>