# Using a custom HttpTransport in ElasticSearch

**URL:** <https://discuss.elastic.co/t/using-a-custom-httptransport-in-elasticsearch/235117>\
**Category:** Elasticsearch\
**Created:** [June 1, 2020, 6:30am UTC](https://discuss.elastic.co/t/using-a-custom-httptransport-in-elasticsearch/235117 "2020-06-01T06:30:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulkarajgikar](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rahulkarajgikar](https://discuss.elastic.co/u/rahulkarajgikar)\
**Post date:** [June 1, 2020, 6:30am UTC](https://discuss.elastic.co/t/using-a-custom-httptransport-in-elasticsearch/235117/1 "2020-06-01T06:30:26Z")

</div>

Hi everyone,

So I've created a` NetworkPlugin` that uses a custom HttpTransport. I've also registered it using `NetworkPlugin.getHttpTransports()`. However, when I install this plugin and run ES, it doesn't seem to be using my Http Transport. After looking at `NetworkModule.java`, I found this:

```auto
/** Adds an http transport implementation that can be selected by setting {@link #HTTP_TYPE_KEY}. */
    private void registerHttpTransport(String key, Supplier<HttpServerTransport> factory) {
        if (transportHttpFactories.putIfAbsent(key, factory) != null) {
            throw new IllegalArgumentException("transport for name: " + key + " is already registered");
        }
    }

```

Now it says I have to set `HTTP_TYPE_KEY` to select my HttpTransport. I couldn't find any way to set this. Can someone please tell me how to set this parameter?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 29, 2020, 6:30am UTC](https://discuss.elastic.co/t/using-a-custom-httptransport-in-elasticsearch/235117/2 "2020-06-29T06:30:27Z")

</div>

Closed on June 29, 2020, 6:30am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
