Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,15 @@ public boolean isConnected() {
public void disconnect() {
connector.disconnect();
}

/**
* Get a socket id
* To use broadcast-> toOthers in laravel
* You must add the X-Socket-ID: {socketId} to the header.
*/
public void socketId() {
if(connector.getSocket() == null) return null
return connector.getSocket().id();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,8 @@ public void disconnect() {
channels.clear();
socket.disconnect();
}

public Socket getSocket() {
return socket;
}
}