Comments (5)
Hi Tom,
Do you need to pass everything (including channel name and socket id) via headers or do you just want to send additional headers in auth requests?
In the first case, you can't do that right now without implementing a new authorizer. You'd need to provide a special function and assign it to the Pusher.authorizers object - https://github.com/pusher/pusher-js/blob/master/src/pusher_authorizer.js#L31. The code is not great, it should get a significant refactoring in the next major release.
Otherwise, I think you can just pass an auth option to the Pusher constructor, like this:
new Pusher("xxx", {
auth: {
headers: {
"header name": "header value"
}
}
});
from pusher-js.
Hey, second option sounds like it would work - thanks, I did look around and couldn't find this documented anywhere btw...
from pusher-js.
@tommoor the docs are here: http://pusher.com/docs/client_api_guide/client_connect#options_parameter
Sounds like there should be something on the authenticating users docs that highlights this functionality.
from pusher-js.
Perfect, appreciated.
from pusher-js.
I'll add it to the README, because most options are already documented there.
from pusher-js.
Related Issues (20)
- PWA HOT 1
- Constant connection state changes when using other than ws transports HOT 3
- Not actuall stats HOT 6
- Pusher-JS doesnt play well with NextJS 14 : Uncaught SyntaxError: Unexpected token ':' HOT 3
- Providing Custom Handler, Internal Endpoint Still Calls
- Pusher client is not binding correctly on presence channels but on public ones yes HOT 2
- Pusher websocket URL triggering events and sending data HOT 1
- This is a test.
- testing
- PageSpeed Insights Failed: net::ERR_NAME_NOT_RESOLVED HOT 2
- Feature - Attach additional params in `subscribe` method for channel auth
- test123
- test bracatinga
- test samambaia
- test araucaria
- test pinus grandis
- test hortencia
- test hoverboat
- await pusher.get() returning unresolved promise
- Is pusherjs still under active development?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pusher-js.