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

Added support of custom transport #473

wants to merge 6 commits into from

Added support of custom transport #473

wants to merge 6 commits into from


Copy link

@speedblue speedblue commented Oct 6, 2013

Allow to plug a custom remote backend (for example a backend with authentification)

Copy link

@jharding jharding commented Feb 9, 2014

In v0.10.0, I made it possible to define your own remote transport. So if you wanted to just web sockets for whatever reason, you could do something like:

var source = new Bloodhound({
  remote: {
    url: '/remote',
    send: function(url, o, onSuccess, onError) {
      // use websockets
      // onSuccess should be invoked with the suggestions
      // onError should be invoked if something went wrong


$('.typeahead').typeahead(null, {
  source: source

FYI, I'm actually renaming send to transport in v0.10.1 (which should go out tomorrow).

Also, in my implementation, you'll still get rate limiting and caching for free.

Thanks for the pull request and I apologize it took me so long to address it.

@jharding jharding closed this Feb 9, 2014
Copy link

@redox redox commented Feb 9, 2014

Awesome, thank you @jharding!

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

Successfully merging this pull request may close these issues.

None yet

4 participants