• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Node.js SDK)
  4. Initialization
  5. Configuring an Instance of ObsClient

Configuring an Instance of ObsClient

You can set the following initialization parameters to configure an instance of ObsClient.

Parameter

Description

Recommended Value

access_key_id

AK

N/A

secret_access_key

SK

N/A

is_secure

Whether to use HTTPS to connect OBS. The default value is true.

Default value

server

OBS endpoint.

N/A

port

Port number. The default value is 80 when HTTP is used and that is 443 when HTTPS is used.

N/A

max_retry_count

Maximum number of retries when an HTTP/HTTPS connection is abnormal. The default value is 3.

[1, 5]

timeout

Timeout period (in seconds) of an HTTP/HTTPS request. The default value is 60.

[10, 60]

ssl_verify

Whether to verify server-side certificates. Possible values are:

  • Path to the server-side root certificate file in .pem format
  • false: The server-side certificates will not be verified.

The default value is false.

N/A

long_conn_param

Long connection mode (in seconds) If the value is equal to or larger than 0, the long connection mode is enabled and this value is used as the initial delay of the TCP Keep-Alive packets.

By default, this parameter is left blank, which indicates that long connection is disabled.

N/A

NOTE:
  • Parameters whose recommended value is N/A need to be set according to the actual conditions.
  • If the network is unstable, you are advised to set a larger value for timeout.

If the long connection mode is enabled, you must call ObsClient.close to close ObsClient explicitly to reclaim connection resources.