Skip to content

Commit

Permalink
Merge pull request #102 from ngrok/bob/1.1.0
Browse files Browse the repository at this point in the history
1.1.0
  • Loading branch information
bobzilladev committed Mar 5, 2024
2 parents 2eb52dc + 9ab88fb commit fc94d44
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.1.0:

- Add `app_protocol(string)` to http and labeled listener builders, and `app_protocol: string` as a `ngrok.forward()` argument. Setting this to "http2" will enable HTTP/2 support to the backend application.

## 1.0.0

- Add policy support to Listener builders and `ngrok.forward`
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "ngrok-python"
version = "1.0.0"
version = "1.1.0"
description = "The ngrok Agent SDK for Python"

[lib]
Expand Down
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/http_listener_builder.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/labeled_listener_builder.doctree
Binary file not shown.
8 changes: 7 additions & 1 deletion docs/genindex.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/http_listener_builder.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/labeled_listener_builder.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions examples/hypercorn-http2-ngrok.py
Expand Up @@ -6,21 +6,26 @@

config = Config()


async def app(scope, receive, send):
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
(b'content-type', b'text/plain'),
],
})
await send({
'type': 'http.response.body',
'body': b'hello',
})
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [
(b"content-type", b"text/plain"),
],
}
)
await send(
{
"type": "http.response.body",
"body": b"hello",
}
)


logging.basicConfig(level=logging.INFO)
ngrok.forward(addr="localhost:8080", authtoken_from_env=True, app_protocol="http2")
config.bind = ["localhost:8080"]
asyncio.run(serve(app, config))
asyncio.run(serve(app, config))
2 changes: 2 additions & 0 deletions python/ngrok/ngrok.pyi
Expand Up @@ -69,6 +69,7 @@ class SessionBuilder:
class HttpListenerBuilder:
def allow_cidr(self, cidr: str) -> HttpListenerBuilder: ...
def allow_user_agent(self, regex: str) -> HttpListenerBuilder: ...
def app_protocol(self, app_protocol: str) -> HttpListenerBuilder: ...
def basic_auth(self, username: str, password: str) -> HttpListenerBuilder: ...
def circuit_breaker(self, circuit_breaker: float) -> HttpListenerBuilder: ...
def compression(self) -> HttpListenerBuilder: ...
Expand Down Expand Up @@ -112,6 +113,7 @@ class HttpListenerBuilder:
def websocket_tcp_conversion(self) -> HttpListenerBuilder: ...

class LabeledListenerBuilder:
def app_protocol(self, app_protocol: str) -> LabeledListenerBuilder: ...
def label(self, label: str, value: str) -> LabeledListenerBuilder: ...
def listen(self) -> Awaitable[Listener]: ...
def listen_and_forward(self, url: str) -> Awaitable[Listener]: ...
Expand Down

0 comments on commit fc94d44

Please sign in to comment.