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

[nginx] define resolver directive in the config #508

Merged
merged 1 commit into from
Nov 28, 2017
Merged

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Nov 28, 2017

so cosockets use internal resolver and don't have to
go through APIcast resolver.

Closes #488

local insert = table.insert
local concat = table.concat
local re = require('ngx.re')

local function parse_nameservers()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this method be exposed in resty.resolver?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resty.resolver exposes the nameservers as tables with some metamethods. Those objects can be joined with table.join so they have to be serialized first into ip:port. I guess it is worth a comment in the code. Will fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That helps 👍


for _,nameserver in ipairs(resolver.init_nameservers()) do
-- resty.resolver returns nameservers as tables with __tostring metamethod
-- unfrotunately those objects can't be joined with table.concat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭕️ Ⓜ️ :godmode:

so cosockets use internal resolver and don't have to
go through APIcast resolver.

Closes #488
@mikz mikz merged commit 0613e63 into master Nov 28, 2017
@mikz mikz deleted the nginx-resolver branch November 28, 2017 16:14
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

Successfully merging this pull request may close these issues.

Define resolver in nginx config
2 participants