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

Update README #668

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ ably.WithHTTPClient(&http.Client{
})
```

**Important Note** - Connection reliability is totally dependent on health of proxy server and ably will not be responsible for errors introduced by proxy server.
**Important Note** - Connection reliability is totally dependent on health of proxy server and ably will not be responsible for errors introduced by proxy server. You may need to increase request timeouts in order to compensate for connection wait time period introduced by proxy server.
e.g use of `WithHTTPRequestTimeout`, `WithRealtimeRequestTimeout`.

## Note on usage of ablytest package
Although the `ablytest` package is available as a part of ably-go, we do not recommend using it as a sandbox for your own testing, since it's specifically intended for client library SDKs and we don’t provide any guarantees for support or that it will remain publicly accessible.
Expand Down Expand Up @@ -432,11 +433,11 @@ Our [current approach to versioning](https://ably.com/documentation/client-lib-d

## Feature support

This library targets the Ably 1.2 [client library specification](https://ably.com/docs/client-lib-development-guide/features). List of available features for our client library SDKs can be found on our [feature support matrix](https://ably.com/download/sdk-feature-support-matrix) page.
This library targets the Ably 2.0.0 [client library specification](https://sdk.ably.com/builds/ably/specification/main/features/#CSV1). List of available features can be found on our [feature support matrix](https://sdk.ably.com/builds/ably/ably-go/main/features/) page.

## Known limitations

As of release 1.2.0, the following are not implemented and will be covered in future 1.2.x releases. If there are features that are currently missing that are a high priority for your use-case then please [contact Ably customer support](https://ably.com/support). Pull Requests are also welcomed.
As of latest release, the following features are not implemented and will be covered in future releases. If there are features that are currently missing that are a high priority for your use-case then please [contact Ably customer support](https://ably.com/support). Pull Requests are also welcomed.

### REST API

Expand Down
20 changes: 19 additions & 1 deletion ablytest/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,29 @@ func NewSandbox(config *Config) (*Sandbox, error) {
return NewSandboxWithEnv(config, Environment)
}

// This code is copied from options.go
func hasActiveInternetConnection(httpClient *http.Client) bool {
res, err := httpClient.Get("https://internet-up.ably-realtime.com/is-the-internet-up.txt")
if err != nil || res.StatusCode != 200 {
return false
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
return false
}
return bytes.Contains(data, []byte("yes"))
}

func NewSandboxWithEnv(config *Config, env string) (*Sandbox, error) {
httpClient := NewHTTPClient()
if !hasActiveInternetConnection(httpClient) {
return nil, errors.New("internet is not available, cannot setup ably sandbox")
}
app := &Sandbox{
Config: config,
Environment: env,
client: NewHTTPClient(),
client: httpClient,
}
if app.Config == nil {
app.Config = DefaultConfig()
Expand Down
Loading