-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Is it possible to use site_encrypt with Plug instead of Phoenix? #24
Comments
Yeah, Plug is currently not supported out of the box. I agree with you that technically it should be possible. The code is mostly designed to be independent of Phoenix. Unless I missed something, the only two modules which should depend on Phoenix are One problem is that How does that sound? |
Thanks for your response. That sounds like a good plan, please ping me when your refactoring is done. |
So I've pushed minor refactoring in the branch support_plug. This branch introduces a new module called Basically you need to include These callback functions need to return the following:
The consequence of 3 is that the child_spec in 2 must start two plug sites, one for http and another for https, which basically means that the childspec should describe a supervisor which starts the two sites as its children. You'll notice that My proposal is to try implementing a prototype hardcoded plug adapter, i.e. a module which combines the new To use the new implementation in tests, you'll need a modified version of My feeling is that compared to Phoenix, Plug will be somewhat more complicated to support. Phoenix made some things easier because:
With Plug we will probably need to do more work, but I'm not certain on the exact details, which is why I'm proposing the hardcoded experiment first. Let me know what you think, and feel free to ask if you have any questions. |
@sasa1977 could you provide the sample code required for integrating with Plug similarly to what done for Phoenix? thanks |
I cannot find any documentation for it. It doesn't seem technically impossible to use with Plug directly but it doesn't seem supported when reading through the docs and code. If it is already possible then I would appreciate some pointers to put me in the right direction.
If it is not currently possible I would be willing to contribute if you want to add support for it, but some guidance on how you would want it work would be appreciated before I start.
The text was updated successfully, but these errors were encountered: