Overriding Socket#on method and adding package dependencies