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

Why we can't read stream during the access phase #2

Open
daxiong380380 opened this issue Jun 27, 2016 · 5 comments
Open

Why we can't read stream during the access phase #2

daxiong380380 opened this issue Jun 27, 2016 · 5 comments

Comments

@daxiong380380
Copy link

After I put a patch to nginx,I find that nginx can't read stream,can we do any thing to solve the problem

@daxiong380380
Copy link
Author

@ryeyao If we can't read the TCP stream during the access phase,which phase can we do that?
I have been trapped for long time , could you give me a hand :)
Thank you very much.

@ryeyao
Copy link
Owner

ryeyao commented Jun 28, 2016

After I put a patch to nginx,I find that nginx can't read stream,can we do any thing to solve the problem

@daxiong380380 It would be nice if you descibe the problem more specificlly for it might help others reading this issue.

If we can't read the TCP stream during the access phase,which phase can we do that?
I have been trapped for long time , could you give me a hand :)

Try to read socket within content_by_lua* directive. Note that this directive can not coexist with proxy_pass.
I will take a look at this as long as I get some time. Also patches are welcome

@daxiong380380
Copy link
Author

daxiong380380 commented Jun 28, 2016

After I put a patch to nginx,I find that nginx can't read stream,can we do any thing to solve the problem

@ryeyao I'm sorry to that ,I mean I can't read the stream during the access phase after patched nginx-allow_override_stream_access_handler.patch & nginx-init_session_before_access_handler.patch .

As you say, we can read socket within content_by_lua directive,but if I use the content* directive,I can't use proxy_pass.In my project,I plan to read and parse the socket,then I can choose the proxy address,so I can send the socket stream to the address that I have set.
I don't know whether there is some methods to achieve my aim.
Thank you .

@daxiong380380
Copy link
Author

@ryeyao
Hi,
I plan to use the cosocket to the server during the content phase,so I shoud create tcp socket and connect it, when I create tcp socket during the content phase,I'd like to save this socket so that I can reuse it in the next requst,is this idea correctly?
or are there some other ways to reuse the socket in several request?

@ryeyao
Copy link
Owner

ryeyao commented Aug 27, 2016

Hi,
I plan to use the cosocket to the server during the content phase,so I shoud create tcp socket and connect it, when I create tcp socket during the content phase,I'd like to save this socket so that I can reuse it in the next requst,is this idea correctly?

Correct (hopefully). (sorry for taking so long to reply..)

or are there some other ways to reuse the socket in several request?

There should be several ways to achieve this (which I am not familiar with). You may ask openresty group for some help.

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