![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@sealsystems/connect-service
Advanced tools
Connects to a service with given host name and port number.
$ npm install @sealsystems/connect-service
First you need to add a reference to @sealsystems/connect-service within your application.
const connectService = require('@sealsystems/connect-service');
Please note: A connection to consul must already exist before you can use the module.
To create a HTTP/HTTPS connection to an instance of a service (e.g. myService
), use:
const consul = require('@sealsystems/consul');
consul.connect(...);
const client = await connectService({
service: 'myService',
path: '/job',
consul
}, {
name: 'hostname',
port: 3000
});
client.on('response', (response) => {
console.log(`Response status: ${response.statusCode}`);
});
client.write('Hello service!');
client.end();
The first parameter is an options
object that can contain the following properties:
property | type | description |
---|---|---|
service | required string | Name of the service to access |
consul | required object | Initialized instance of node-consul |
headers | optional object | Additional HTTP/HTTPS headers |
method | optional string | HTTP/HTTPS method, default POST |
path | optional string | URL-path to access, default / |
Here is an example of a more complete options
object:
const options = {
headers: {
'content-type': 'application/json'
},
method: 'POST',
path: '/url/path',
service: 'myService',
consul
};
Second parameter is the host name and port number. Example:
const host = {
name: 'hostname',
port: 3000
};
The return value client
contains a http.ClientRequest object for further use.
The protocol used for a connection depends on the target (local or remote) and the value of the environment variable TLS_UNPROTECTED. The TLS certificates provided by @sealsystems/tlscert
will be used for HTTPS connections. It is not possible to override the chosen protocol.
To build this module use roboter.
$ bot
FAQs
Connects to a service.
We found that @sealsystems/connect-service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.