# When i use this "Python client v4 explicit connection", does the url for http\_host and grpc\_host include schema(protocol) or not?

**URL:** <https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755>\
**Category:** Support\
**Created:** [June 20, 2024, 9:29pm UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755 "2024-06-20T21:29:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alisha\_liu](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/alisha_liu/32/1035_2.png) [@alisha\_liu](https://forum.weaviate.io/u/alisha_liu)\
**Post date:** [June 20, 2024, 9:29pm UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/1 "2024-06-20T21:29:35Z")

</div>

```auto
import weaviate
from weaviate.connect import ConnectionParams
from weaviate.classes.init import AdditionalConfig, Timeout
import os

client = weaviate.WeaviateClient(
    connection_params=ConnectionParams.from_params(
        http_host="localhost",
        http_port="8099",
        http_secure=False,
        grpc_host="localhost",
        grpc_port="50052",
        grpc_secure=False,
    ),
    auth_client_secret=weaviate.auth.AuthApiKey("secr3tk3y"),
    additional_headers={
        "X-OpenAI-Api-Key": os.getenv("OPENAI_APIKEY")
    },
    additional_config=AdditionalConfig(
        timeout=Timeout(init=2, query=45, insert=120), # Values in seconds
    ),
)

client.connect()

```

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 21, 2024, 11:11am UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/2 "2024-06-21T11:11:19Z")

</div>

Hi!

You shouldn’t include the schema/protocol on the url host.

this is an example of the code you posted that will work, for example, with our cloud services:

```auto
import weaviate
from weaviate.connect import ConnectionParams
from weaviate.classes.init import AdditionalConfig, Timeout
import os

client = weaviate.WeaviateClient(
    connection_params=ConnectionParams.from_params(
        http_host="3lhcpqlpqje13fdggbzpmg.c1-1.europe-west3.gcp.weaviate.cloud",
        http_port="443",
        http_secure=True,
        grpc_host="grpc-3lhcpqlpqje13fdggbzpmg.c1-1.europe-west3.gcp.weaviate.cloud",
        grpc_port="443",
        grpc_secure=True,
    ),
    auth_client_secret=weaviate.auth.AuthApiKey("Z......3"),
    additional_headers={
        "X-OpenAI-Api-Key": os.getenv("OPENAI_APIKEY")
    },
    additional_config=AdditionalConfig(
        timeout=Timeout(init=2, query=45, insert=120), # Values in seconds
    ),
)

client.connect()

```

Let me know if this helps!

THanks!

---

<div class="post-metadata">

**Author:** ![alisha\_liu](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/alisha_liu/32/1035_2.png) [@alisha\_liu](https://forum.weaviate.io/u/alisha_liu)\
**Post date:** [June 21, 2024, 11:25am UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/3 "2024-06-21T11:25:44Z")

</div>

Thank you so much helping me with the issues, I am clear now.  
Can I ask you some suggestion to fix client connect issues with python v4? I struggle with it for two days 😢

Scenario:  
Weaviate instance in hosted in AWS Kubernetes.

when I use weaviate.WeaviateClient() to connect with it with the correct patten of url host as your mentioned , I got “httpcore.ConnectTimeout: timed out” and "httpx.ConnectTimeout: timed out " error, how to fix it?

Can I set http\_host and grpc\_host with the same url host?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 21, 2024, 11:51am UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/4 "2024-06-21T11:51:44Z")

</div>

Hi! This seems like a deployment issue rather than a client issue.

After self deploying, using docker or k8s, for example, it is up to the sys admin to properly expose Weaviate under a TLS/SSL connection.

If exposing at all, as some users keep Weaviate under a backend, only exposing the backend.

So while exposing the service, in k8s for example, you can keep the same url for both grpc and http, or use different ones, but it need to be handled accordingly by your k8s load balance.

Have you used our helm chart for this deployment?

---

<div class="post-metadata">

**Author:** ![alisha\_liu](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/alisha_liu/32/1035_2.png) [@alisha\_liu](https://forum.weaviate.io/u/alisha_liu)\
**Post date:** [June 21, 2024, 12:04pm UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/5 "2024-06-21T12:04:36Z")

</div>

> [@DudaNogueira](#):
>
> If exposing at all, as some users keep Weaviate under a backend, only exposing the backend

No, I did not use helm chart for this deployment.  
I have gitlab repository to configure Kubernes, the files used to configure port 8080 and 50051 inside these five files:  
`kustomization.yaml`, `service.yaml`, `deployment.yaml`, `ingress.yaml`, `Dockerfile`.

Dose use helm chart to deploy will solve my issues?

Based on my current deploy solution, can you give me some suggestion to solve my problem?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [June 21, 2024, 8:21pm UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/6 "2024-06-21T20:21:22Z")

</div>

I have only used our helm chart for deployment so not sure what could be happening there with a custom deployment.

Can you try deploying using the helm chart? Or trying to check the helm for something different it may have be doing?

---

<div class="post-metadata">

**Author:** ![alisha\_liu](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/alisha_liu/32/1035_2.png) [@alisha\_liu](https://forum.weaviate.io/u/alisha_liu)\
**Post date:** [June 22, 2024, 2:32am UTC](https://forum.weaviate.io/t/when-i-use-this-python-client-v4-explicit-connection-does-the-url-for-http-host-and-grpc-host-include-schema-protocol-or-not/2755/7 "2024-06-22T02:32:51Z")

</div>

Thank you so much for your help, let me try it
