In my phoenix channel I need to do some things that requires me to know what domain the request was made for. Example: https://beta.example.com vs https://www.example.com. Is there any way to access that information from or pass that information to a phoenix channel?
Asked
Active
Viewed 354 times
1 Answers
0
A quick and dirty way would be to add that to the main page on the initial page, then explicitly pass it when the client pushes the message. I have a number of settings I store on the page. I also have wrappers around the channel push to add those values on each push.
I have not looked into the transport stuff in the socket struct. You could dive into those also. Just inspect the socket and look through each of the fields.

Steve Pallen
- 4,417
- 16
- 33