Add a middleware for promoting a connection to WebSocket (fix #205) #206

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
@arteymix
Member

arteymix commented Feb 25, 2017

No description provided.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Feb 25, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@97f3792). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #206   +/-   ##
========================================
  Coverage          ?   62.3%           
========================================
  Files             ?      40           
  Lines             ?    1369           
  Branches          ?     170           
========================================
  Hits              ?     853           
  Misses            ?     448           
  Partials          ?      68
Impacted Files Coverage Δ
src/vsgi/vsgi-request.vala 67.37% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97f3792...7360801. Read the comment docs.

codecov-io commented Feb 25, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@97f3792). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #206   +/-   ##
========================================
  Coverage          ?   62.3%           
========================================
  Files             ?      40           
  Lines             ?    1369           
  Branches          ?     170           
========================================
  Hits              ?     853           
  Misses            ?     448           
  Partials          ?      68
Impacted Files Coverage Δ
src/vsgi/vsgi-request.vala 67.37% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97f3792...7360801. Read the comment docs.

@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Jan 14, 2018

Any chance of resurrecting this?

Any chance of resurrecting this?

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jan 15, 2018

Member

I'll look into it tomorrow.

Member

arteymix commented Jan 15, 2018

I'll look into it tomorrow.

@arteymix arteymix closed this Jan 15, 2018

@arteymix arteymix reopened this Jan 15, 2018

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jan 15, 2018

Member

I just tested the handshake so far, but I'll write a unit test using the client that comes with libsoup-2.4.

Member

arteymix commented Jan 15, 2018

I just tested the handshake so far, but I'll write a unit test using the client that comes with libsoup-2.4.

@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Jan 15, 2018

Looking good, been wanting to have a serious play with valum for a while and I now find myself needing a WebSocket server. Having looked at the insanity of doing that in PHP it seemed as good a time as any to finally get valum out.

Looking good, been wanting to have a serious play with valum for a while and I now find myself needing a WebSocket server. Having looked at the insanity of doing that in PHP it seemed as good a time as any to finally get valum out.

@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Jan 28, 2018

Anything I could do to push this over the line?

Anything I could do to push this over the line?

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jan 30, 2018

Member

I finally managed to make it work! I'll push the testcase in a few hours (I have a course now).

Member

arteymix commented Jan 30, 2018

I finally managed to make it work! I'll push the testcase in a few hours (I have a course now).

Add a middleware for promoting a connection to WebSocket (fix #205)
Call 'next' if the client does not want to establish a handshake.

Add some documentation to cover the WebSocket middleware.
@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jan 31, 2018

Member

I wrote the test case against the example, but I'll complete it later. Meanwhile, you can test it and give it some feedback.

I'll try to fix the CI..

Member

arteymix commented Jan 31, 2018

I wrote the test case against the example, but I'll complete it later. Meanwhile, you can test it and give it some feedback.

I'll try to fix the CI..

@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Feb 1, 2018

Seem to have run into some problems that seem to be around valum expecting http:// but (at least in js) only ws://(or wss://) is valid for WebSocket connections.

Also ninja seems to timeout on the websocket test and my simple soup client reports

The server did not accept the WebSocket handshake.

Seem to have run into some problems that seem to be around valum expecting http:// but (at least in js) only ws://(or wss://) is valid for WebSocket connections.

Also ninja seems to timeout on the websocket test and my simple soup client reports

The server did not accept the WebSocket handshake.
@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Feb 1, 2018

Okay pulled latest commit, now I get

ERROR:websocket-test.vala:18:__lambda5_: code should not be reached

For the test

Okay pulled latest commit, now I get

ERROR:websocket-test.vala:18:__lambda5_: code should not be reached

For the test

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Feb 1, 2018

Member

You need to start the example application to run the test until I include it in the unit test itself. I think I'll use a fork for starting the server part.

Member

arteymix commented Feb 1, 2018

You need to start the example application to run the test until I include it in the unit test itself. I think I'll use a fork for starting the server part.

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Feb 1, 2018

Member

I think I've found why it was not working, the Connection header can contains a param list.

I'll release a 0.4 with WebSocket support along with VSGI 1.0 soon after this get merged. I'd like to make it to the next TechEmpower benchmark!

Member

arteymix commented Feb 1, 2018

I think I've found why it was not working, the Connection header can contains a param list.

I'll release a 0.4 with WebSocket support along with VSGI 1.0 soon after this get merged. I'd like to make it to the next TechEmpower benchmark!

@ZanderBrown

This comment has been minimized.

Show comment
Hide comment
@ZanderBrown

ZanderBrown Feb 1, 2018

Connecting to examples/app /websocket in JS seems to work for me now

Connecting to examples/app /websocket in JS seems to work for me now

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Feb 1, 2018

Member

It was fixed in cea368d

Since it's working, I've merged the work into the trunk and I'll include the testcase later.

Member

arteymix commented Feb 1, 2018

It was fixed in cea368d

Since it's working, I've merged the work into the trunk and I'll include the testcase later.

@arteymix arteymix closed this Feb 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment