Skip to content

Question: Can I connect to Polaris NTRIP using UrlHttpConnection from Java/Kotlin? #62

@Ba0Nguyen

Description

@Ba0Nguyen

`
val urlString = "https://polaris.pointonenav.com:2101\n"

            val url = URL(urlString)
            val connection = url.openConnection() as HttpURLConnection
            // Set up basic authentication
            val usernameAndPassword = "$username:$password"
            val encoded = usernameAndPassword.encode(StandardCharsets.ISO_8859_1).base64()
            connection.setRequestProperty("Authorization", "Basic $encoded")
            connection.setRequestProperty("Ntrip-Version", "Ntrip/2.0")
            // Set request method (GET, POST, etc.)
            connection.setRequestMethod("GET")
            
            // connection.addRequestProperty("Ntrip-GGA", initialMessage)

            connection.doOutput = true;
            connection.doInput = true;

`

I used to code above to attempt to connect to Polaris NTRIP Server but failed to do so. Do I need any header or sending initial message to connect with Polaris NTRIP ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions