Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow auth headers #661

Closed
shinneider opened this issue Mar 26, 2021 · 1 comment
Closed

Allow auth headers #661

shinneider opened this issue Mar 26, 2021 · 1 comment
Assignees
Labels

Comments

@shinneider
Copy link

Hi.

In my actual project a i need to send auth header in client to server, but de in client no has this option.
i created a workaround for this... i overrided _handle_eio_connect in socketio/client.py and add data manually on send func line 624 ex. self._send_packet(packet.Packet(packet.CONNECT, namespace=n, data={....}))

but is great functionality of socket io, and i suggest create official way to send...

@shinneider
Copy link
Author

shinneider commented Mar 26, 2021

My code suggestion:

class Client(Client):
    ...
    auth_data = None
    
    ...
    
    def add_auth(self, data):
        self.auth_data = data

    def _handle_eio_connect(self):
        ....
        self._send_packet(Packet(CONNECT, namespace=n, data=self.auth_data))
            

to add data just sio.add_auth({...})

allow to create a PR ?

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

No branches or pull requests

2 participants