Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple backend sites #1

Open
DanielHeath opened this issue Feb 8, 2016 · 5 comments
Open

Support multiple backend sites #1

DanielHeath opened this issue Feb 8, 2016 · 5 comments

Comments

@DanielHeath
Copy link
Contributor

This looks really cool :)

I'm hosting multiple sites on the same IP - if I get time (doubtful) I might try & implement multiple backing sites (golang has SNI natively on the server).

Any thoughts RE the command line arguments for this?

@jtolio
Copy link
Owner

jtolio commented Feb 8, 2016

hah I was totally thinking the same thing! I actually just pushed https://github.com/spacemonkeygo/tlshowdy yesterday as well (not that it's needed here since this just uses crypto/tls anyway), so it was on my mind.

I think the main challenge right now is that I'm just using the flag package for arg parsing, and that's probably the wrong thing to keep using. I suspect that the best commandline UX for multiple backing sites would be some form of repeated flag and the flag package doesn't do repeated flags well. I'd expect a UX like:

lecat -m site1.domain.tld:target1:port2 -m site2.domain.tld:target2:port2 ...

so maybe we pull in github.com/codegangsta/cli?

Dunno, if you get to it before I do (likely, even though you said doubtful), I'd be thrilled to merge a pull request

@DanielHeath
Copy link
Contributor Author

I can think of a few alternatives:

  • Use a library from outside the stdlib
  • Have one flag and use strings to process it (e.g. lecat -sites site1.tld:target1:port1,site2.tld:target2:port2)
  • Accept sites one-per-line via STDIN / config file

@jtolio
Copy link
Owner

jtolio commented Feb 8, 2016

i'm leaning toward the first option. we do the second (comma-separated) at $dayjob and it works but it's not my favorite. the third option seems like it reduces the setup simplicity of the tool, but might be a good choice in addition to 1. but yeah, whatever works

@DanielHeath
Copy link
Contributor Author

Fair point RE 3 - I'm used to shell hackery eg echo 'foo.bar:localhost:8080' | lecat but it's not widespread knowledge.

I'd be in favor of defaulting target to localhost (so you can do foo.bar:8080).

@DanielHeath
Copy link
Contributor Author

DanielHeath commented Apr 23, 2016

Wait a second - I just realized you don't need any special libs after all for this syntax. They can be normal positional arguments instead of flags.

lecat [options] site1.domain.tld:target1:port1 [site2.domain.tld:target2:port2...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants