Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Allow for serving HTTP over UNIX sockets #115

Merged
merged 2 commits into from
Nov 12, 2013

Conversation

stouset
Copy link
Contributor

@stouset stouset commented Nov 8, 2013

No description provided.

@stouset
Copy link
Contributor Author

stouset commented Nov 8, 2013

Interestingly, doing it this way ended up removing a bunch of code from SSLServer. It shouldn't be too difficult to merge this PR with my previous one to add verification of client SSL certs.

Tests are forthcoming. Wanted to get this out there for comment first.

@@ -20,17 +20,36 @@ class Server
# @option options [true] spy on the request
#
# @return [Reel::SSLServer] Reel HTTPS server actor
def initialize(host, port, options = {}, &callback)
def self.new(host, port, options = {} , &callback)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the approach of overriding ::new for backwards compatibility. This way, #initialize can expect to be provided an underlying evented server.

Copy link

Choose a reason for hiding this comment

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

I would make this a code comment.

@sconover
Copy link

sconover commented Nov 8, 2013

lgtm so far

tarcieri added a commit that referenced this pull request Nov 12, 2013
Allow for serving HTTP over UNIX sockets
@tarcieri tarcieri merged commit d6609ac into celluloid:master Nov 12, 2013
@Asmod4n
Copy link
Contributor

Asmod4n commented Nov 12, 2013

So.. how are you supposed to create a unix Server now? Calling Reel::Server.unix only throws an exception because the super in there can't do anything.

@stouset stouset deleted the http-over-unix-sockets branch November 12, 2013 20:38
@stouset stouset restored the http-over-unix-sockets branch November 12, 2013 20:41
@stouset
Copy link
Contributor Author

stouset commented Nov 12, 2013

You're right. I'd been waiting for feedback on the approach before writing tests, but the factory is broken as currently written.

@tarcieri
Copy link
Member

😢

@stouset stouset deleted the http-over-unix-sockets branch November 12, 2013 21:01
@Asmod4n
Copy link
Contributor

Asmod4n commented Nov 12, 2013

What about changing the API and adding something like URL schemes to setup Servers?
Have wrapped it up a bit

https://gist.github.com/Asmod4n/2a340d35da82a4ffda1b

@stouset
Copy link
Contributor Author

stouset commented Nov 12, 2013

@Asmod4n I already have a fix that includes the promised tests. :)

@Asmod4n
Copy link
Contributor

Asmod4n commented Nov 12, 2013

Would still love it to be able to write down a url like Reel::Server.new('https:///path/to/socket') to start a new Server ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants