1.0.1 • Published 6 years ago

di-interceptor v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Intercepting WebSocket creations

const interceptor = this.manager.get('Interceptor');
interceptor.on('websocket-intercepted', iee => {
  if(iee.ws.url.includes("dealer.spotify.com")) this.spotifyWS = iee;
  iee.on('data', this.spotifyData);
});

Intercepting HTTP requests

const interceptor = this.manager.get('Interceptor');
interceptor.on('request-open', (url, method, iee) => {
  if(url.includes("spotify.com")) iee.on('data', this.handleSpotifyRequest);
});