nitrogen / simple_bridge

A simple, standardized interface library to Erlang HTTP Servers.
MIT License
112 stars 76 forks source link

cowboy's "start_http" API has been replaced by start_clear #61

Closed RobertSwirsky closed 5 years ago

RobertSwirsky commented 7 years ago

simple_bridge doesn't work with the latest version of cowboy, as "start_http" API has been replaced by "start_clear"

choptastic commented 7 years ago

Thanks! I knew that Loic was heavily reworking Cowboy for 2.0, but I haven't yet looked into the details.

For now, SimpleBridge's cowboy support is only tested to work with the 1.x branch, but as the API stabilizes, it'll be time to start adding support for cowboy 2.

If you have time, I'm certainly open to a pull request that updates the API (I'd pull it into a dev branch until cowboy2 gets officially released). There are very likely a handful more breaking changes than just the start_http/start_clear change.

-Jesse

On Tue, Nov 1, 2016 at 12:30 PM, Robert Swirsky notifications@github.com wrote:

simple_bridge doesn't work with the latest version of cowboy, as "start_http" API has been replaced by "start_clear"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nitrogen/simple_bridge/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/AALYnFBQpiUMBj-AP_tvlsBRRDwTl3Zoks5q53c2gaJpZM4KmWsE .

Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm

RobertSwirsky commented 7 years ago

I've cloned it and I'm trying to get it to work, so if I'm successful I'll give you a pull request.

I'm down in the weeds right now: I'm poking around in simple_bridge because I need a newer cowboy which might fix the problem I had with websockets in ChicagoBoss! (Someday, I need to switch to Phoenix / Elixir, but I haven't learned Elixir yet.)

The need to upgrade was because the old Cowboy didn't work right with Apple Safari WebSockets on iOS. (I'm not sure if the new one does, either).

Apparently Websockets don't just work, and there are several standards of the versions. If you're curious, you can google for things like "hixie-76" and "hubi-10" and read the gory details!

On Tue, Nov 1, 2016 at 10:38 AM, Jesse Gumm notifications@github.com wrote:

Thanks! I knew that Loic was heavily reworking Cowboy for 2.0, but I haven't yet looked into the details.

For now, SimpleBridge's cowboy support is only tested to work with the 1.x branch, but as the API stabilizes, it'll be time to start adding support for cowboy 2.

If you have time, I'm certainly open to a pull request that updates the API (I'd pull it into a dev branch until cowboy2 gets officially released). There are very likely a handful more breaking changes than just the start_http/start_clear change.

-Jesse

On Tue, Nov 1, 2016 at 12:30 PM, Robert Swirsky notifications@github.com wrote:

simple_bridge doesn't work with the latest version of cowboy, as "start_http" API has been replaced by "start_clear"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nitrogen/simple_bridge/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/AALYnFBQpiUMBj-AP_ tvlsBRRDwTl3Zoks5q53c2gaJpZM4KmWsE .

Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nitrogen/simple_bridge/issues/61#issuecomment-257635309, or mute the thread https://github.com/notifications/unsubscribe-auth/AMc7XC5uMQ8Nki0b_1QvN7FYuPCv4FXnks5q53kHgaJpZM4KmWsE .

choptastic commented 7 years ago

I'm excited to see if you're able to solve this. I was unaware of problems with Cowboy's websockets with iOS, but if iOS's safari uses a deprecated websocket protocol, I could see that being a problem.

Even still, support for Cowboy 2 is something that has to happen anyway, so at least it's not for naught.

Good luck!

RobertSwirsky commented 7 years ago

I really need to move off of ChicagoBoss, but I'm stubborn and don't want to learn Elixir. All our "core" code for chatterbeak is written in pure Erlang. I may just go to "raw" Cowboy and skip the framework.

On Thu, Nov 3, 2016 at 5:48 AM, Jesse Gumm notifications@github.com wrote:

I'm excited to see if you're able to solve this. I was unaware of problems with Cowboy's websockets with iOS, but if iOS's safari uses a deprecated websocket protocol, I could see that being a problem.

Even still, support for Cowboy 2 is something that has to happen anyway, so at least it's not for naught.

Good luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nitrogen/simple_bridge/issues/61#issuecomment-258133061, or mute the thread https://github.com/notifications/unsubscribe-auth/AMc7XDNN8YtiJR9-NhGgTkSWTTMaaLbdks5q6dg2gaJpZM4KmWsE .

choptastic commented 7 years ago

You could go raw Cowboy, but if the problem is within cowboy itself, it won't solve your iOS problem. Similarly if you go Elixir/Phoenix, Phoenix runs on top of Cowboy also (afaik), which would, again, present that as a problem.

You could also try one of the other backends SimpleBridge supports (Yaws or Mochiweb). Yaws has its own websocket implementation (and maybe it handles the deprecated version of the protocol), or if you try Mochiweb, it'll use simpleBridge's built-in websocket handler which, while I don't recall adding support for hixie-76 as it's been a few years since I wrote that code, it does pass the tests in the autobahn test suite so it's worth a shot to see if it works there.

Changing backends for simple_bridge is pretty simple

choptastic commented 5 years ago

Cowboy 2 support is officially live.