Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1070715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:36:26+00:00 2026-05-16T20:36:26+00:00

(This question has been downvoted, which I find strange. How have I offended?) Am

  • 0

(This question has been downvoted, which I find strange. How have I offended?)

Am I right to think that running a swank server usually opens port 4005 to the world, not bound to localhost-only connections?

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.

It appears that when I run a swank server with either ‘mvn clojure:swank’, or ‘lein swank’, or (swank.swank/start-server “/tmp/yo”)

then I get something like (thanks Mike!):

$lsof -i -P
java      11693 john   13r  IPv6 6701891      0t0  TCP *:34983 (LISTEN)

and indeed I can connect from an emacs running on another machine on the same network.

(swank.swank/start-server "/tmp/yo")

If I start the server by hand, it produces the following output

Connection opened on local port  34983
#<ServerSocket ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=34983]>

Whereas:

(swank.swank/start-server "/tmp/yo" :host "localhost")

produces:

Connection opened on local port  40368
#<ServerSocket ServerSocket[addr=localhost/127.0.0.1,port=0,localport=40368]>

Which seems more like I was expecting.

Is there any good reason for doing this?

Any ideas on how it the more conventional ways of starting it could be persuaded to only accept connections from local processes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:36:27+00:00Added an answer on May 16, 2026 at 8:36 pm

    Totally valid question.

    After opening a slime server, you’ll notice:

    eames:~:% lsof -i -P | grep 4005
    java      41477  mjd   33u  IPv6 0x0b8956d0      0t0  TCP [::127.0.0.1]:4005 (LISTEN)
    

    The connection is listening on the local address at port 4005. This interface isn’t exposed to the network, so other devices on the network can’t connect to your slime server.

    edit:

    This was my result of starting swank using leiningen, which provides “localhost” as an argument to swank.swank/start-server. You may want to double check that the leiningen plugin is opening non-local ports.

    You’re right that swank opens the connection on every address if a host isn’t explicitly provided. The relevant code is swank.util.net.sockets/make-server-socket, and this behavior is documented. I agree, it seems like the wrong default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has been retitled/retagged so that others may more easily find the solution
This question has been asked before, but none that I have reviewed give a
This question has been striking me for many days... Let's say I have a
This question has been asked before mentioning the lib or includes that provides a
This question has been asked before ( link ) but I have slightly different
This might get downvoted, but this question has been bothering me since yesterday.. until
This question has been asked before, but the answered ones I could find were
This question has been asked a number of times, I have noted, but none
This question has been asked again and again, but I have still a doubt.
This question has been bugging me for a while Is it usual to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.