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

Add TSGI Layer Between Router and Server #81

Merged
merged 10 commits into from
May 18, 2019

Conversation

ASverdlov
Copy link
Contributor

Overview

Read TSGI Spec Draft for details on TSGI layer.

I consider this PR as an alpha version of tarantool/http 2.0: new features, more breaking changes may be introduced.

Changes

  • Add NGINX TSGI Adapter. Allows to use existing router (with some minor restrictions) with nginx-upstream-module.
  • Decouple Server from Router
  • Tests on nginx-/builtin- adapter. See test_locally.sh.

TODO

  1. Enhance documentation.

1. Distinct subfolders nginx_server/ server/ for
NGINX and builtin servers.
2. Extract common (not specific to particular
tsgi adapter) code to http/tsgi.lua.
As it is used in both builtin- and nginx-
servers, its extracted to common http/tsgi module.
README.md Outdated
@@ -208,11 +208,13 @@ end
* `req.headers` - normalized request headers. A normalized header
is in the lower case, all headers joined together into a single string.
* `req.peer` - a Lua table with information about the remote peer
(like `socket:peer()`).
(like `socket:peer()`). **NOTE**: not available when using NGINX TSGI
adapter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Хотелось бы оставить socket:peer() частично рабочим.

Пользователь может смотреть адрес клиента - логировать, анализировать, етц.

Michael Filonenko, [13 May 2019 at 11:20:51]:
логирование, и вдруг поднимут два нжинкса, захотят посмотреть кто говнит

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@filonenko-mikhail
Copy link
Contributor

Please add doc file with TSGI spec

host and port are extracted via
box.session.peer().

family, type and protocol are hardcoded.
@ASverdlov ASverdlov merged commit 1cc26ed into tarantool:v2alpha May 18, 2019
knazarov pushed a commit that referenced this pull request Oct 4, 2019
Changes done:
1. decompose the code into modular pieces
2. decouple router and server parts
3. introduce nginx as possible Web Server via TSGI adapter
4. enable router tests on NGINX

Note: this change breaks connection stealing.
@ligurio ligurio mentioned this pull request Oct 22, 2021
ligurio pushed a commit that referenced this pull request Oct 27, 2021
Changes done:
1. decompose the code into modular pieces
2. decouple router and server parts
3. introduce nginx as possible Web Server via TSGI adapter
4. enable router tests on NGINX

Note: this change breaks connection stealing.
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.

2 participants