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

Do not register connector if the port/host is not set when using commandLineEnvironment() #670

Closed
Spartakovic opened this issue Oct 23, 2018 · 4 comments

Comments

@Spartakovic
Copy link

commented Oct 23, 2018

commandLineEnvironment() is a convinient function to parse configs, but it registers a connector no matter what. I don't want to expose non ssl connectors and the only way to do it is to parse configs myself, which is mostly copy paste from this function.

I don't see a reason to register a connector by default even when it's not specified in the configs.

@cy6erGn0m

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2018

What if we provide a way to disable the default 80th connector? Something like -P:port=0 -P:sslPort=443 ?

@orangy

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2018

I think better solution would be indeed no default connector, but in case of no connector registered at all, bail out with a diagnostic message telling people what to do. Especially when config is (accidentally) not found – currently error message ktor config not found is not very helpful.

@Spartakovic

This comment has been minimized.

Copy link
Author

commented Oct 23, 2018

Agree on having no default connector and a diagnostic message

cy6erGn0m added a commit that referenced this issue Oct 23, 2018
@cy6erGn0m

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2018

Fixed in 1.0.0-beta-2

@cy6erGn0m cy6erGn0m closed this Oct 24, 2018

dave08 added a commit to dave08/ktor that referenced this issue Nov 11, 2018
schleinzer pushed a commit to schleinzer/ktor that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.